<!DOCTYPE html><html class="hide-aside" lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><title>python自动化办公实例 | Akilarの糖果屋</title><meta name="keywords" content="diary; experience; tutorial;"><meta name="author" content="Akilar"><meta name="copyright" content="Akilar"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="提供两个python自动化办公实例及思路，用作对excel进行数据切片，并以此生成简历表。"><meta property="og:type" content="article"><meta property="og:title" content="python自动化办公实例"><meta property="og:url" content="https://akilar.top/posts/58249fc9/"><meta property="og:site_name" content="Akilarの糖果屋"><meta property="og:description" content="提供两个python自动化办公实例及思路，用作对excel进行数据切片，并以此生成简历表。"><meta property="og:locale" content="zh_CN"><meta property="og:image" content="https://pic3.zhimg.com/v2-2070e0ba5c733a9ad4395d52b4c7ae8f_1440w.jpg?source=172ae18b"><meta property="article:published_time" content="2022-05-16T10:15:23.000Z"><meta property="article:modified_time" content="2022-06-23T14:18:23.000Z"><meta property="article:author" content="Akilar"><meta property="article:tag" content="diary; experience; tutorial;"><meta name="twitter:card" content="summary"><meta name="twitter:image" content="https://pic3.zhimg.com/v2-2070e0ba5c733a9ad4395d52b4c7ae8f_1440w.jpg?source=172ae18b"><link rel="shortcut icon" href="https://npm.elemecdn.com/akiblog@1.0.1/img/siteicon/favicon.png"><link rel="canonical" href="https://akilar.top/posts/58249fc9/" media="defer" onload='this.media="all"'><link rel="preconnect" href="//cdn.jsdelivr.net"><link rel="preconnect" href="//at.alicdn.com/"><link rel="preconnect" href="//cdnjs.cloudflare.com/"><link rel="preconnect" href="//sdk.51.la"><meta name="google_site_verification" content="INnh6jnldNB3hxjSoa9ut7Kd9xX9R6Mqe7807EJsbCc"><meta name="baidu-site-verification" content="code-6O1kXu3a70"><meta name="msvalidate.01" content="3A07763DBFF970229752E8DF7999C30D"><link rel="manifest" href="/manifest.json"><link rel="apple-touch-icon" sizes="180x180" href="https://npm.elemecdn.com/akiblog@1.0.1/img/image/siteicon/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="https://npm.elemecdn.com/akiblog@1.0.1/img/siteicon/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="https://npm.elemecdn.com/akiblog@1.0.1/img/siteicon/favicon-16x16.png"><link rel="mask-icon" href="https://npm.elemecdn.com/akiblog@1.0.1/img/siteicon/safari-pinned-tab.svg" color="#5bbad5"><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://npm.elemecdn.com/@fortawesome/fontawesome-free@6.1.2/css/all.min.css" media="print" onload='this.media="all"'><link rel="stylesheet" href="https://npm.elemecdn.com/node-snackbar@0.1.16/dist/snackbar.min.css" media="print" onload='this.media="all"'><div class="js-pjax"><script charset="UTF-8" id="LA_COLLECT" src="https://sdk.51.la/js-sdk-pro.min.js"></script><script>LA.init({id:"JdyxkljyWpUOuTqt",ck:"JdyxkljyWpUOuTqt"})</script></div><script src="https://sdk.51.la/perf/js-sdk-perf.min.js" crossorigin="anonymous"></script><script>(new LingQue.Monitor).init({id:"JdzAJUCrdUGoOC7D"})</script><link rel="stylesheet" href="https://npm.elemecdn.com/akiblog@1.0.1/css/animate.min.css" media="print" onload='this.media="screen"'><link rel="stylesheet" href="https://npm.elemecdn.com/swiper@8.4.2/swiper-bundle.min.css" media="print" onload='this.media="all"'><script>const GLOBAL_CONFIG={root:"/",algolia:{appId:"STO7Z288QA",apiKey:"dbcfd77c89c49f19b42d68e572943881",indexName:"akilar",hits:{per_page:3},languages:{input_placeholder:"搜索文章",hits_empty:"找不到您查询的内容：${query}",hits_stats:"找到 ${hits} 条结果，用时 ${time} 毫秒"}},localSearch:void 0,translate:{defaultEncoding:2,translateDelay:0,msgToTraditionalChinese:"<i>繁</i><sapn>簡繁轉換</span>",msgToSimplifiedChinese:"<i>简</i><sapn>简繁转换</span>"},noticeOutdate:{limitDay:30,position:"top",messagePrev:"It has been",messageNext:"days since the last update, the content of the article may be outdated."},highlight:{plugin:"highlighjs",highlightCopy:!0,highlightLang:!0,highlightHeightLimit:130},copy:{success:"吾辈宣布你的剪贴板已经被我占领啦！",error:"抱歉，复制好像出了点问题。",noSupport:"你的浏览器好像不支持"},relativeDate:{homepage:!1,post:!1},runtime:"天",date_suffix:{just:"刚刚",min:"分钟前",hour:"小时前",day:"天前",month:"个月前"},copyright:void 0,lightbox:"mediumZoom",Snackbar:{chs_to_cht:"你已切换为繁体",cht_to_chs:"你已切换为简体",day_to_night:"你已切换为深色模式",night_to_day:"你已切换为浅色模式",bgLight:"#49B1F5",bgDark:"#1f1f1f",position:"top-center"},source:{justifiedGallery:{js:"https://npm.elemecdn.com/flickr-justified-gallery@2.1.2/dist/fjGallery.min.js",css:"https://npm.elemecdn.com/flickr-justified-gallery@2.1.2/dist/fjGallery.css"}},isPhotoFigcaption:!0,islazyload:!0,isAnchor:!1}</script><script id="config-diff">var GLOBAL_CONFIG_SITE={title:"python自动化办公实例",isPost:!0,isHome:!1,isHighlightShrink:!1,isToc:!0,postUpdate:"2022-06-23 14:18:23"}</script><noscript><style>#nav{opacity:1}.justified-gallery img{opacity:1}#post-meta time,#recent-posts time{display:inline!important}</style></noscript><script>(e=>{e.saveToLocal={set:function(e,t,o){if(0===o)return;const a=864e5*o,n={value:t,expiry:(new Date).getTime()+a};localStorage.setItem(e,JSON.stringify(n))},get:function(e){const t=localStorage.getItem(e);if(!t)return;const o=JSON.parse(t);if(!((new Date).getTime()>o.expiry))return o.value;localStorage.removeItem(e)}},e.getScript=e=>new Promise((t,o)=>{const a=document.createElement("script");a.src=e,a.async=!0,a.onerror=o,a.onload=a.onreadystatechange=function(){const e=this.readyState;e&&"loaded"!==e&&"complete"!==e||(a.onload=a.onreadystatechange=null,t())},document.head.appendChild(a)}),e.activateDarkMode=function(){document.documentElement.setAttribute("data-theme","dark"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","#0d0d0d")},e.activateLightMode=function(){document.documentElement.setAttribute("data-theme","light"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","#ffffff")};const t=saveToLocal.get("theme"),o=(new Date).getHours();void 0===t?o<=6||o>=18?activateDarkMode():activateLightMode():"light"===t?activateLightMode():activateDarkMode();const a=saveToLocal.get("aside-status");void 0!==a&&("hide"===a?document.documentElement.classList.add("hide-aside"):document.documentElement.classList.remove("hide-aside"));/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)&&document.documentElement.classList.add("apple")})(window)</script><link rel="stylesheet" href="https://npm.elemecdn.com/akiblog@1.0.1/css/custom.css" media="defer" onload='this.media="all"'><link rel="stylesheet" href="https://widget.heweather.net/simple/static/css/he-simple.css?v=1.4.0" media="defer" onload='this.media="all"'><script src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/SAO-Notify.js" async></script><script async src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/carousel-touch.js"></script><svg aria-hidden="true" style="position:absolute;overflow:hidden;width:0;height:0"><symbol id="icon-sun" viewBox="0 0 1024 1024"><path d="M960 512l-128 128v192h-192l-128 128-128-128H192v-192l-128-128 128-128V192h192l128-128 128 128h192v192z" fill="#FFD878" p-id="8420"></path><path d="M736 512a224 224 0 1 0-448 0 224 224 0 1 0 448 0z" fill="#FFE4A9" p-id="8421"></path><path d="M512 109.248 626.752 224H800v173.248L914.752 512 800 626.752V800h-173.248L512 914.752 397.248 800H224v-173.248L109.248 512 224 397.248V224h173.248L512 109.248M512 64l-128 128H192v192l-128 128 128 128v192h192l128 128 128-128h192v-192l128-128-128-128V192h-192l-128-128z" fill="#4D5152" p-id="8422"></path><path d="M512 320c105.888 0 192 86.112 192 192s-86.112 192-192 192-192-86.112-192-192 86.112-192 192-192m0-32a224 224 0 1 0 0 448 224 224 0 0 0 0-448z" fill="#4D5152" p-id="8423"></path></symbol><symbol id="icon-moon" viewBox="0 0 1024 1024"><path d="M611.370667 167.082667a445.013333 445.013333 0 0 1-38.4 161.834666 477.824 477.824 0 0 1-244.736 244.394667 445.141333 445.141333 0 0 1-161.109334 38.058667 85.077333 85.077333 0 0 0-65.066666 135.722666A462.08 462.08 0 1 0 747.093333 102.058667a85.077333 85.077333 0 0 0-135.722666 65.024z" fill="#FFB531" p-id="11345"></path><path d="M329.728 274.133333l35.157333-35.157333a21.333333 21.333333 0 1 0-30.165333-30.165333l-35.157333 35.157333-35.114667-35.157333a21.333333 21.333333 0 0 0-30.165333 30.165333l35.114666 35.157333-35.114666 35.157334a21.333333 21.333333 0 1 0 30.165333 30.165333l35.114667-35.157333 35.157333 35.157333a21.333333 21.333333 0 1 0 30.165333-30.165333z" fill="#030835" p-id="11346"></path></symbol></svg><link rel="stylesheet" href="https://npm.elemecdn.com/hexo-filter-gitcalendar/lib/gitcalendar.css" media="print" onload='this.media="all"'><meta name="generator" content="Hexo 6.2.0"><link rel="alternate" href="/atom.xml" title="Akilarの糖果屋" type="application/atom+xml"></head><body><div id="loading-box"><div class="ark-loading" id="ark-loading"><div class="ark-loading-top-container"><div class="ark-loading-top-left-flash"></div><div class="ark-loading-top-left-border"></div><div class="ark-loading-top-triangle"></div><div class="ark-loading-top-right-border"></div><div class="ark-loading-top-right-flash"></div></div><div class="ark-loading-bottom-container"><div class="ark-loading-bottom-left-border"></div><div class="ark-loading-bottom-left-triangle"></div><div class="ark-loading-bottom-center-border"></div><div class="ark-loading-bottom-right-triangle"></div><div class="ark-loading-bottom-right-border"></div></div><div class="ark-loading-main-container"><div class="ark-loading-content"><div class="ark-loading-power-left"></div><div class="ark-loading-center-left-border"></div><div class="ark-loading-cab-outside-border"><div class="ark-loading-cab-insideborder"><div class="ark-loading-cab-container"><div class="ark-loading-percentage"></div><div class="ark-loading-tip"></div></div></div></div><div class="ark-loading-center-right-border"></div><div class="ark-loading-power-right"></div></div></div></div></div><div id="web_bg"><style>#web_bg{background:url(https://pic3.zhimg.com/v2-2070e0ba5c733a9ad4395d52b4c7ae8f_1440w.jpg?source=172ae18b)!important;background-attachment:local!important;background-position:center!important;background-size:cover!important;background-repeat:no-repeat!important}[data-theme=dark] #web_bg{background:url(https://npm.elemecdn.com/akiblog@1.0.1/img/basenight.webp)!important;background-attachment:local!important;background-position:center!important;background-size:cover!important;background-repeat:no-repeat!important}</style></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="" data-lazy-src="https://npm.elemecdn.com/akiblog@1.0.1/img/author.webp" onerror='onerror=null,src="https://npm.elemecdn.com/akiblog@1.0.1/img/404.gif"' alt="avatar"></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">480</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">63</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">6</div></a></div><hr><div class="menus_items"><div class="menus_item"><a class="site-page faa-parent animated-hover" href="/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-laptop"></use></svg> <span>博客</span></a></div><div class="menus_item"><a class="site-page faa-parent animated-hover" href="/archives/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-Calendar"></use></svg> <span>时间轴</span></a></div><div class="menus_item"><a class="site-page faa-parent animated-hover" href="/tags/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-strategy"></use></svg> <span>标签</span></a></div><div class="menus_item"><a class="site-page faa-parent animated-hover" href="/fcircle/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-forumdiscusstion"></use></svg> <span>朋友圈</span></a></div><div class="menus_item"><a class="site-page faa-parent animated-hover" href="/link/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-connection"></use></svg> <span>友人帐</span></a></div><div class="menus_item"><a class="site-page faa-parent animated-hover" href="/comments/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-letter"></use></svg> <span>留言板</span></a></div><div class="menus_item"><a class="site-page group faa-parent animated-hover" href="javascript:void(0);" rel="external nofollow noreferrer"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-hourglass"></use></svg> <span>生活</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="faa-parent animated-hover site-page child" href="/gallery/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-strategy"></use></svg> <span>相册</span></a></li><li><a class="faa-parent animated-hover site-page child" href="/bangumis/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-unicorn"></use></svg> <span>追番</span></a></li><li><a class="faa-parent animated-hover site-page child" href="/about/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-Achievement"></use></svg> <span>关于</span></a></li></ul></div><div class="menus_item"><a class="site-page faa-parent animated-hover" href="javascript:toRandomPost()" rel="external nofollow noreferrer"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-teamwork"></use></svg> <span>随便看看</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image:url(https://pic3.zhimg.com/v2-2070e0ba5c733a9ad4395d52b4c7ae8f_1440w.jpg?source=172ae18b)"><div class="menu-container" id="menu-container"><div class="menu-item"><div class="menu-item-main"><a class="site-page faa-parent animated-hover" href="/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-laptop"></use></svg> <span>博客</span></a></div><div class="menu-item-main"><a class="site-page faa-parent animated-hover" href="/archives/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-Calendar"></use></svg> <span>时间轴</span></a></div><div class="menu-item-main"><a class="site-page faa-parent animated-hover" href="/tags/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-strategy"></use></svg> <span>标签</span></a></div><div class="menu-item-main"><a class="site-page faa-parent animated-hover" href="/fcircle/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-forumdiscusstion"></use></svg> <span>朋友圈</span></a></div><div class="menu-item-main"><a class="site-page faa-parent animated-hover" href="/link/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-connection"></use></svg> <span>友人帐</span></a></div><div class="menu-item-main"><a class="site-page faa-parent animated-hover" href="/comments/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-letter"></use></svg> <span>留言板</span></a></div><div class="menu-item-main has-child"><div class="menu-item-parent"><a class="site-page faa-parent animated-hover" href="javascript:void(0);" rel="external nofollow noreferrer"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-hourglass"></use></svg> <span>生活</span></a></div><div class="menu-item-child"><a class="faa-parent animated-hover site-page child" href="/gallery/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-strategy"></use></svg> <span>相册</span></a></div><div class="menu-item-child"><a class="faa-parent animated-hover site-page child" href="/bangumis/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-unicorn"></use></svg> <span>追番</span></a></div><div class="menu-item-child"><a class="faa-parent animated-hover site-page child" href="/about/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-Achievement"></use></svg> <span>关于</span></a></div></div><div class="menu-item-main"><a class="site-page faa-parent animated-hover" href="javascript:toRandomPost()" rel="external nofollow noreferrer"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-teamwork"></use></svg> <span>随便看看</span></a></div></div><div class="top-bar"><div class="message-container"><div class="message-item message-weather" onclick="btf.scrollToDest(0,500)"><div class="message-weather-box" id="he-plugin-simple"></div></div><div class="message-item message-date" onclick="Navvisible()"><div class="message-date-box" id="message-date-box"></div><div class="message-title-box" id="message-title-box"><a id="site-name" title="提供两个python自动化办公实例及思路，用作对excel进行数据切片，并以此生成简历表。">python自动化办公实例</a></div></div><div class="message-item message-function"><div id="search-button"><a class="site-page social-icon search faa-parent animated-hover"><svg class="faa-tada icon" style="height:25px;width:25px" aria-hidden="true"><use xlink:href="#icon-analitic"></use></svg> <span>搜索</span></a></div><a class="icon-V hidden faa-parent animated-hover" onclick="switchNightMode()" title="昼夜切换"><svg class="faa-tada" width="25" height="25" viewBox="0 0 1024 1024"><use id="modeicon" xlink:href="#icon-moon"></use></svg></a><div id="toggle-menu"><a class="site-page faa-parent animated-hover"><svg class="faa-tada icon" style="height:25px;width:25px" aria-hidden="true"><use xlink:href="#icon-MobileApps"></use></svg></a></div></div></div></div><button class="active-button" onclick="Navvisible()"></button></div><div id="post-info"><h1 class="post-title">python自动化办公实例<a class="post-edit-link" href="https://github.com/Akilarlxh/Hexo-blog-source/edit/master/source/_posts/Akilarの糖葫芦/杂项内容/python自动化办公实例.md" rel="external nofollow noreferrer" title="编辑" target="_blank"><i class="fas fa-feather-alt faa-tada animated-hover"></i></a></h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-05-16T10:15:23.000Z" title="发表于 2022-05-16 10:15:23">2022-05-16</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-06-23T14:18:23.000Z" title="更新于 2022-06-23 14:18:23">2022-06-23</time></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">8.7k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>30分钟</span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="python入门"><a href="#python入门" class="headerlink" title="python入门"></a>python入门</h2><div class="tip cogs"><p><code>python</code>作为一门面向对象编程的语言，有着许多优点，我们可能已经听到过很多关于<code>python</code>的传说，比如这些年大火的人工智能领域涉及的机器学习，图像识别，自动化办公领域涉及的文件批量化处理，自动分析，导出报表等。</p></div><p>事实上，<code>python</code>之所以被如此广泛的应用，得益于它的语法简单，阅读容易，而且开源，与<code>C/C++</code>、<code>JAVA</code>、<code>C#</code>等老牌编程语言相比，仅需几行代码就能实现其他编程语言花几十行才能实现的效果。跨平台的特点也使得它备受各种第三方库的青睐<span class="hidden-anchor" id="referto_[1]"></span><sup class="reference"><a href="#referfrom_[1]">[1]</a></sup><span class="reference-bubble"><span class="reference-item"><span class="reference-literature">小白师哥.知乎——python为什么更适用于AI[OL]，2021-11-03</span><span class="reference-title">参考资料</span></span></span>。</p><p>使用python完成一些办公过程中的重复操作，能够很好的起到事半功倍的效果。</p><p>首先，针对python零基础入门，我推荐是通过视频网课或者在线网站教程进行学习，同时辅以相应的工具书，便于编写过程中自行查阅。<br>以下是我学习过程中用到的自觉比较浅显易懂的学习网站和工具书。</p><ol><li>在线学习网站：<div class="tag link"><a class="link-card" title="Python教程-廖雪峰的官方网站" href="https://www.liaoxuefeng.com/wiki/1016959663602400" rel="external nofollow noreferrer"><div class="left"><img src="" data-lazy-src="https://api.iowen.cn/favicon/ https://www.liaoxuefeng.com/wiki/1016959663602400.png"></div><div class="right"><p class="text">Python教程-廖雪峰的官方网站</p><p class="url">https://www.liaoxuefeng.com/wiki/1016959663602400</p></div></a></div><ul><li>这个网站的优点在于有个讨论的社区环境，遇到不懂的地方可以直接评论提问，而且还有打卡和线上编写简单程序的功能，学习的反馈周期比较短，不容易感到枯燥。如果单纯是以本帖讨论的自动化办公极限编程而言，学完到《模块》为止的前七章就足够了。重点是要了解python中用到的数据结构和条件、分支、循环等语句的运用，当然还包括python原生的几个自带的函数方法。在接下来的自动化办公中，会经常需要用到<strong>循环迭代</strong>和<strong>字典数据结构</strong>相关的内容。</li></ul></li><li>工具书，此处提供电子版：<div class="tag link"><a class="link-card" title="Python基础教程（第三版）.人民邮电出版社" target="_blank" rel="noopener external nofollow noreferrer" href="https://wwi.lanzoup.com/iCb8704wtvah"><div class="left"><img src="" data-lazy-src="https://api.iowen.cn/favicon/wwi.lanzoup.com/iCb8704wtvah.png"></div><div class="right"><p class="text">Python基础教程（第三版）.人民邮电出版社</p><p class="url">https://wwi.lanzoup.com/iCb8704wtvah</p></div></a></div><ul><li>这本工具书的优点就是它的内容是完全面向纯新手的，从python安装到使用，每一步都详细说明。同时提供教学示例和开发实例。不过实际教学内容和上文的在线网站其实是类似的。有实体工具书的话，主要是方便学习记忆。毕竟拿在手里的学起来比较有实感。</li></ul></li></ol><h2 id="引文"><a href="#引文" class="headerlink" title="引文"></a>引文</h2><p>因为我们的目的是使用python来完成办公过程中重复次数较多的工作，所以我这里就以标书编制过程中，比较繁琐的<strong>人员安排表编写</strong>和<strong>人员简历表导出</strong>两个情景作为编写实例进行讲述。</p><p>我会从程序编写完成后期望实现的交互情景入手，提取出交互过程中的输入输出内容，并根据输入输出过程中遇到的问题提供查找答案的思路，最后提供编写完成的带详细注释的实例源码。</p><div class="tip warning"><p>这两个实例的原理了解以后，有兴趣学习的小伙伴可以以此为框架，完成对任何一种excel格式存储的数据源进行横向纵向数据切片的任务，同时根据导出的数据源渲染任意重复用到该导出数据源的表格模板。从复用性和实用性上来说，这两个实例还是很有参考价值的。</p></div><h2 id="实例1——数据切片导出"><a href="#实例1——数据切片导出" class="headerlink" title="实例1——数据切片导出"></a>实例1——数据切片导出</h2><ol><li>首先，我们的目的是要把需要的人员信息从堪称琳琅满目的人员清册中提取出来，所以至少第一步，我们要把人员清册导入。导入的人员清册作为一个变量，方便后面使用python对其进行操作。</li><li>然后，按照以往编制的经验来看，我们挑选人员是以评分表中的资质证书要求为参考方向，然后根据评分要求决定大概需要多少人，所以第二步应当考虑根据具体的搜索条件匹配和需要的人数来进行对人员清册表中<strong>行的提取</strong>。</li><li>在对行进行提取，也就是完成了<span class="bubble-content">横向截取切片</span><span class="bubble-notation"><span class="bubble-item" style="background-color:#d4716c">此处用截取，是因为需要把根据输入的搜索条件匹配到的人员信息取出并存放到新的变量中，用截取强调此操作涉及数据源和新的数据容器两个变量</span></span>以后，需要根据简历表格式或者招标文件给出的人员安排表表头，对冗余的列进行裁剪，完成<span class="bubble-content">纵向裁剪切片</span><span class="bubble-notation"><span class="bubble-item" style="background-color:#00c4b6">此处用裁剪，是因为这一步操作是对截取出的新的数据列表进行裁切，去掉多余列，用裁剪强调此操作是仅对新的数据容器这一个变量进行操作</span></span>。</li><li>最后，因为之前只是对缓存中的数据进行操作，我们还需要将完成横向纵向切片的数据导出到新的excel文件里进行保存。</li><li>由此确定了最初的输入输出框架：<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">&quot;&quot;&quot;</span></span><br><span class="line"><span class="string">输入示例：</span></span><br><span class="line"><span class="string">OUT:请输入文件路径：</span></span><br><span class="line"><span class="string">IN:售前投标用人员清册.xlsx</span></span><br><span class="line"><span class="string">OUT:正在对数据进行清洗，去除空值，补全缺值。</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">OUT:请输入需要查询的列值信息及所需数量，如&quot;证书1,测绘作业证,3&quot;</span></span><br><span class="line"><span class="string">IN:证书1,测绘作业证,3</span></span><br><span class="line"><span class="string">OUT:查询到n条信息，是否继续添加,YES OR NO</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">IN: YES</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">OUT:请输入需要查询的列值信息及所需数量，如&quot;证书1,测绘作业证,3&quot;</span></span><br><span class="line"><span class="string">IN:证书1,测绘作业证,3</span></span><br><span class="line"><span class="string">OUT:查询到n条信息，是否继续添加,YES OR NO</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">IN: NO</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">OUT:已获取您所需的表格信息，请输入您所需表头对应的列名。</span></span><br><span class="line"><span class="string">OUT:请输入您所需的表头:</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">IN:姓名,性别,年龄,证书资质,学历</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">OUT:信息整合完毕，请输入您想要保存的文件名:</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">IN:投标人员信息表.xlsx</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">OUT:已完成导出</span></span><br><span class="line"><span class="string">&quot;&quot;&quot;</span></span><br></pre></td></tr></table></figure><h3 id="编写过程梳理"><a href="#编写过程梳理" class="headerlink" title="编写过程梳理"></a>编写过程梳理</h3></li></ol><div class="tabs" id="数据切片"><ul class="nav-tabs"><li class="tab active"><button type="button" data-href="#数据切片-1">流程图</button></li><li class="tab"><button type="button" data-href="#数据切片-2">代码框架</button></li><li class="tab"><button type="button" data-href="#数据切片-3">思维导图罗列问题</button></li><li class="tab"><button type="button" data-href="#数据切片-4">补充提示文字</button></li><li class="tab"><button type="button" data-href="#数据切片-5">程序源码</button></li></ul><div class="tab-contents"><div class="tab-item-content active" id="数据切片-1"><p>根据设计好的输入输出示例，我画出了相应的流程图<br><img src="" data-lazy-src="https://npm.elemecdn.com/akilar-candyassets/image/dataextract.png" alt=""></p><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div><div class="tab-item-content" id="数据切片-2"><p>然后在流程图基础上罗列出基本的代码框架<br></p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#===============================导入人员清册====================</span></span><br><span class="line">DataSourceInput = <span class="built_in">input</span>(<span class="string">&quot;请输入文件路径：&quot;</span>);</span><br><span class="line"><span class="comment"># <span class="doctag">TODO:</span>根据人员清册文件路径，导入人员清册文件到DataSource变量</span></span><br><span class="line">DataSource = ...</span><br><span class="line"><span class="comment"># <span class="doctag">TODO:</span>对于数据进行清洗，去除空值，补全缺值，默认补全内容为“商务补充”</span></span><br><span class="line"></span><br><span class="line"><span class="comment">#===============================横向截取切片====================</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 输入需要查询的列值信息及所需数量，如&quot;职业资格名称1，测绘作业证，3&quot;</span></span><br><span class="line">SeqInput = <span class="built_in">input</span>(<span class="string">&quot;请输入需要查询的列值信息及所需数量：&quot;</span>)</span><br><span class="line"><span class="comment"># <span class="doctag">TODO:</span>考虑到输入习惯，用中文逗号做分割，转为list存放到SeqKey变量中</span></span><br><span class="line">SeqKey = ...</span><br><span class="line"><span class="comment"># <span class="doctag">TODO:</span>获取列名为职业资格名称1的列的所有值，保留职业资格名称1为测绘作业证的前几项</span></span><br><span class="line"><span class="comment"># <span class="doctag">TODO:</span>将结果存到SeqResult中</span></span><br><span class="line">SeqResult = ...</span><br><span class="line"><span class="comment">#===============================是否继续添加====================</span></span><br><span class="line"><span class="comment"># 询问是否继续添加,对输入值进行控制</span></span><br><span class="line">BreakInput = <span class="built_in">input</span>(<span class="string">&quot;是否继续添加,YES OR NO :\n&quot;</span>)</span><br><span class="line"><span class="comment"># <span class="doctag">TODO:</span>使用While循环结构实现反复问询是否继续添加</span></span><br><span class="line"><span class="comment"># <span class="doctag">TODO:</span>新增的数据行应该实现和已有数据行的有机合并，所以需要去重,去重后合并的结果保存到SeqResult中</span></span><br><span class="line">SeqResult = ...</span><br><span class="line"><span class="comment">#=======================纵向裁剪切片====================</span></span><br><span class="line"></span><br><span class="line">HeaderListInput = <span class="built_in">input</span>(<span class="string">&quot;请输入需要选用的列名：&quot;</span>)</span><br><span class="line"><span class="comment"># <span class="doctag">TODO:</span>考虑到输入习惯，用中文逗号做分割，转为list存放到HeaderList变量中</span></span><br><span class="line">HeaderList = ...</span><br><span class="line"><span class="comment"># <span class="doctag">TODO:</span>根据指定列名保留需要的列，剔除冗余的列，完成纵向裁剪切片,结果保存到SeqResult中</span></span><br><span class="line">SeqResult = ...</span><br><span class="line"><span class="comment">#===================输出保存至文件===========</span></span><br><span class="line"></span><br><span class="line">SaveFile = <span class="built_in">input</span>(<span class="string">&quot;请输入您想要保存的文件名：&quot;</span>)</span><br><span class="line"><span class="comment"># <span class="doctag">TODO:</span>按文件名将切片结果保存到文件中</span></span><br></pre></td></tr></table></figure><p></p><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div><div class="tab-item-content" id="数据切片-3"><p>根据代码框架，罗列TODO，并根据自己对python中列表、字典等数据结构的了解和条件、分支、循环等语句的运用，提取相应的搜索关键词，确定搜索方向。<br><img src="" data-lazy-src="https://npm.elemecdn.com/akilar-candyassets/image/dataextract_xmind.png" alt=""></p><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div><div class="tab-item-content" id="数据切片-4"><p>因为要考虑到使用者的具体感受，所以推荐在解决了<code>TODO</code>以后，再通过<code>print()</code>函数写一些提示性文字，提示输入示例，引导输入。<br></p><figure class="highlight diff"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br></pre></td><td class="code"><pre><span class="line">  import os</span><br><span class="line">  import pandas as pd</span><br><span class="line">  pd.set_option(&#x27;display.float_format&#x27;,lambda x : &#x27;%d&#x27; % x)</span><br><span class="line">  import numpy as np</span><br><span class="line">  np.set_printoptions(formatter=&#123;&#x27;all&#x27;: lambda x: str(x)&#125;) #禁用科学计数法</span><br><span class="line">  np.set_printoptions(suppress=True) #禁用科学计数法</span><br><span class="line">  from datetime import datetime</span><br><span class="line">  from pandas import Series, DataFrame</span><br><span class="line"></span><br><span class="line">#<span class="comment">===============================导入人员清册====================</span></span><br><span class="line"><span class="deletion">- DataSourceInput = input(&quot;请输入文件路径：&quot;);</span></span><br><span class="line"><span class="addition">+ DataSourceInput = input(&quot;请输入文件路径：\n例如： 售前投标用人员清册2022.3更新.xlsx  \n&quot;);</span></span><br><span class="line"><span class="addition">+ print(&#x27;=&#x27; * 80)</span></span><br><span class="line"><span class="addition">+ print(&#x27;文件:&#x27;, DataSourceInput, &#x27;加载中......&#x27;)</span></span><br><span class="line">  # 根据人员清册文件路径，导入人员清册文件到DataSource变量</span><br><span class="line">  DataSource = pd.read_excel(DataSourceInput)</span><br><span class="line"></span><br><span class="line">  # 对于数据进行清洗，去除空值，补全缺值，默认补全内容为“商务补充”</span><br><span class="line"><span class="addition">+ print(&#x27;正在对数据进行清洗，去除空值，补全缺值......&#x27;)</span></span><br><span class="line">  DataSource = DataSource.dropna(axis=0, how=&#x27;any&#x27;, thresh=5) #删除非空元素小于10个的无效数据</span><br><span class="line">  DataSource = DataSource.fillna(value=&quot;商务补充&quot;)</span><br><span class="line"><span class="addition">+ print(&#x27;=&#x27; * 80)</span></span><br><span class="line"></span><br><span class="line">  #<span class="comment">===============================横向截取切片====================</span></span><br><span class="line"></span><br><span class="line">  # 输入需要查询的列值信息及所需数量，如&quot;职业资格名称1，测绘作业证，3&quot;</span><br><span class="line"><span class="deletion">- SeqInput = input(&quot;请输入需要查询的列值信息及所需数量：&quot;)</span></span><br><span class="line"><span class="addition">+ SeqInput = input(&quot;请输入需要查询的列值信息及所需数量，如：  职业资格名称1，测绘作业证，3  \n请输入需要查询的信息:\n&quot;)</span></span><br><span class="line">  # 考虑到输入习惯，用中文逗号做分割，转为list存放到SeqKey变量中</span><br><span class="line">  SeqKey = SeqInput.split(&quot;，&quot;)</span><br><span class="line">  # 获取列名为职业资格名称1的列的所有值，保留职业资格名称1为测绘作业证的前几项</span><br><span class="line">  SeqCache = DataSource[DataSource[SeqKey[0]].isin([SeqKey[1]])].head(int(SeqKey[2]))</span><br><span class="line">  # 将结果存到SeqResult中</span><br><span class="line">  # 将结果存到SeqResult中</span><br><span class="line">  SeqResult = SeqCache</span><br><span class="line"><span class="addition">+ print(&quot;当前录入人员：===&gt; &quot;,SeqResult[&#x27;姓名&#x27;].values,&quot;&lt;===&quot;)</span></span><br><span class="line">  # 询问是否继续添加,对输入值进行控制</span><br><span class="line">  BreakInput = input(&quot;是否继续添加,YES OR NO :\n&quot;)</span><br><span class="line">  while BreakInput.upper() not in [&quot;YES&quot;, &quot;NO&quot;]:</span><br><span class="line">      BreakInput = input(&quot;输入错误,请重新输入\n是否继续添加,YES OR NO :\n&quot;)</span><br><span class="line">  BreakKey = BreakInput.upper() #规范化输入为大写</span><br><span class="line">  #<span class="comment">===============================是否继续添加====================</span></span><br><span class="line">  # 使用While循环结构实现反复问询是否继续添加</span><br><span class="line">  while BreakKey == &quot;YES&quot; :</span><br><span class="line">      # 输入需要查询的列值信息及所需数量，如&quot;职业资格名称1，测绘作业证，3&quot;</span><br><span class="line">      SeqInput = input(&quot;请输入需要查询的列值信息及所需数量:\n&quot;)</span><br><span class="line">      # 考虑到输入习惯，用中文逗号做分割</span><br><span class="line">      SeqKey = SeqInput.split(&quot;，&quot;)</span><br><span class="line">      # 判断职业资格名称1是否为测绘作业证</span><br><span class="line">      SeqCache = DataSource[DataSource[SeqKey[0]].isin([SeqKey[1]])].head(int(SeqKey[2]))</span><br><span class="line">      # 新增的数据行应该实现和已有数据行的有机合并，所以需要去重,去重后合并的结果保存到SeqResult中</span><br><span class="line">      SeqResult = pd.concat([SeqResult , SeqCache] , ignore_index=False).drop_duplicates()</span><br><span class="line">      print(&quot;当前录入人员：<span class="comment">===&gt; &quot;,SeqResult[&#x27;姓名&#x27;].values,&quot;&lt;===&quot;)</span></span><br><span class="line">      BreakInput = input(&quot;是否继续添加,YES OR NO :  &quot;)</span><br><span class="line">      while BreakInput.upper() not in [&quot;YES&quot;, &quot;NO&quot;]:</span><br><span class="line">          BreakInput = input(&quot;输入错误,请重新输入\n是否继续添加,YES OR NO :  &quot;)</span><br><span class="line">      BreakKey = BreakInput.upper() #规范化输入为大写</span><br><span class="line">  SeqResult=SeqResult.reset_index(drop=True)  #重置索引值</span><br><span class="line">  #<span class="comment">=======================纵向裁剪切片====================</span></span><br><span class="line"><span class="addition">+ print(&#x27;=&#x27; * 80)</span></span><br><span class="line"><span class="deletion">- HeaderListInput = input(&quot;请输入需要选用的列名：&quot;)</span></span><br><span class="line"><span class="addition">+ HeaderListInput = input(&quot;请输入需要选用的列名，\n例如： 姓名，学历，专业，学校，身份证号码，合同编号，手机\n请输入需要选用的列名：\n&quot;)</span></span><br><span class="line">  # 考虑到输入习惯，用中文逗号做分割，转为list存放到HeaderList变量中</span><br><span class="line">  HeaderList = HeaderListInput.split(&quot;，&quot;)</span><br><span class="line">  # 根据指定列名保留需要的列，剔除冗余的列，完成纵向裁剪切片,结果保存到SeqResult中</span><br><span class="line">  SeqResult=SeqResult.loc[:,HeaderList]</span><br><span class="line"></span><br><span class="line">  #<span class="comment">===================输出保存至文件===========</span></span><br><span class="line"><span class="addition">+ print(&quot;正在根据您所输入的列名进行重新排版......\n以下是待保存的数据预览:\n&quot;)</span></span><br><span class="line"><span class="addition">+ print(&#x27;-&#x27; * 80)</span></span><br><span class="line"><span class="addition">+ print(SeqResult)</span></span><br><span class="line"><span class="addition">+ print(&#x27;-&#x27; * 80)</span></span><br><span class="line"><span class="deletion">- SaveFile = input(&quot;请输入您想要保存的文件名：&quot;)</span></span><br><span class="line"><span class="addition">+ SaveFile = input(&quot;信息整合完毕，请输入您想要保存的文件名：\n例如：test.xlsx\n&quot;)</span></span><br><span class="line">  # 按文件名将切片结果保存到文件中</span><br><span class="line">  SeqResult.to_excel(SaveFile, index=False)</span><br></pre></td></tr></table></figure><p></p><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div><div class="tab-item-content" id="数据切片-5"><div class="table-container"><table><thead><tr><th style="text-align:left">变量名</th><th style="text-align:left">数据类型</th><th style="text-align:left">变量释义</th></tr></thead><tbody><tr><td style="text-align:left">DataSourceInput</td><td style="text-align:left">字符串string</td><td style="text-align:left">输入的数据源文件名</td></tr><tr><td style="text-align:left">DataSource</td><td style="text-align:left">二维数据表结构DataFrame</td><td style="text-align:left">根据文件名获取数据源后存放于此变量</td></tr><tr><td style="text-align:left">SeqInput</td><td style="text-align:left">字符串string</td><td style="text-align:left">数据横向截取所需的列值信息及所需数量</td></tr><tr><td style="text-align:left">SeqKey</td><td style="text-align:left">列表list</td><td style="text-align:left">将SeqInput按“，”分割后获得的列表，便于操作</td></tr><tr><td style="text-align:left">SeqCache</td><td style="text-align:left">二维数据表结构DataFrame</td><td style="text-align:left">按照输入的列值信息截取出的数据行</td></tr><tr><td style="text-align:left">SeqResult</td><td style="text-align:left">二维数据表结构DataFrame</td><td style="text-align:left">存放截取的数据行的数据容器</td></tr><tr><td style="text-align:left">BreakInput</td><td style="text-align:left">字符串String</td><td style="text-align:left">输入判断是否继续添加，YES OR NO</td></tr><tr><td style="text-align:left">BreakKey</td><td style="text-align:left">字符串String</td><td style="text-align:left">对BreakInput进行大小写规范化</td></tr><tr><td style="text-align:left">HeaderListInput</td><td style="text-align:left">字符串String</td><td style="text-align:left">数据纵向裁剪所需的表头信息对应列名</td></tr><tr><td style="text-align:left">HeaderList</td><td style="text-align:left">列表list</td><td style="text-align:left">将HeaderListInput按“,”分割后获得的列表，便于操作</td></tr><tr><td style="text-align:left">SaveFile</td><td style="text-align:left">字符串String</td><td style="text-align:left">存放切片结果的文件的名字</td></tr></tbody></table></div><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> os <span class="comment">#os库，涉及文件操作需要用到这个库</span></span><br><span class="line"><span class="keyword">import</span> pandas <span class="keyword">as</span> pd</span><br><span class="line">pd.set_option(<span class="string">&#x27;display.float_format&#x27;</span>,<span class="keyword">lambda</span> x : <span class="string">&#x27;%d&#x27;</span> % x) <span class="comment">#禁用科学计数法</span></span><br><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np <span class="comment">#涉及数学计算的操作需要用到这个库</span></span><br><span class="line">np.set_printoptions(formatter=&#123;<span class="string">&#x27;all&#x27;</span>: <span class="keyword">lambda</span> x: <span class="built_in">str</span>(x)&#125;) <span class="comment">#禁用科学计数法</span></span><br><span class="line">np.set_printoptions(suppress=<span class="literal">True</span>) <span class="comment">#禁用科学计数法</span></span><br><span class="line"><span class="keyword">from</span> datetime <span class="keyword">import</span> datetime <span class="comment">#时间类型的数值需要用到这个库</span></span><br><span class="line"><span class="keyword">from</span> pandas <span class="keyword">import</span> Series, DataFrame</span><br><span class="line"></span><br><span class="line"><span class="comment">#===============================导入人员清册====================</span></span><br><span class="line">DataSourceInput = <span class="built_in">input</span>(<span class="string">&quot;请输入文件路径：\n例如： 售前投标用人员清册2022.3更新.xlsx  \n&quot;</span>);</span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;=&#x27;</span> * <span class="number">80</span>)</span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;文件:&#x27;</span>, DataSourceInput, <span class="string">&#x27;加载中......&#x27;</span>)</span><br><span class="line"><span class="comment"># 根据人员清册文件路径，导入人员清册文件到DataSource变量</span></span><br><span class="line">DataSource = pd.read_excel(DataSourceInput)</span><br><span class="line"></span><br><span class="line"><span class="comment"># 对于数据进行清洗，去除空值，补全缺值，默认补全内容为“商务补充”</span></span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;正在对数据进行清洗，去除空值，补全缺值......&#x27;</span>)</span><br><span class="line">DataSource = DataSource.dropna(axis=<span class="number">0</span>, how=<span class="string">&#x27;any&#x27;</span>, thresh=<span class="number">5</span>) <span class="comment">#删除非空元素小于10个的无效数据</span></span><br><span class="line">DataSource = DataSource.fillna(value=<span class="string">&quot;商务补充&quot;</span>) <span class="comment">#默认补全内容为“商务补充”</span></span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;=&#x27;</span> * <span class="number">80</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment">#===============================横向截取切片====================</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 输入需要查询的列值信息及所需数量，如&quot;职业资格名称1，测绘作业证，3&quot;</span></span><br><span class="line">SeqInput = <span class="built_in">input</span>(<span class="string">&quot;请输入需要查询的列值信息及所需数量，如：  职业资格名称1，测绘作业证，3  \n请输入需要查询的信息:\n&quot;</span>)</span><br><span class="line"><span class="comment"># 考虑到输入习惯，用中文逗号做分割，转为list存放到SeqKey变量中</span></span><br><span class="line">SeqKey = SeqInput.split(<span class="string">&quot;，&quot;</span>)</span><br><span class="line"><span class="comment"># 获取列名为职业资格名称1的列的所有值，保留职业资格名称1为测绘作业证的前几项</span></span><br><span class="line">SeqCache = DataSource[DataSource[SeqKey[<span class="number">0</span>]].isin([SeqKey[<span class="number">1</span>]])].head(<span class="built_in">int</span>(SeqKey[<span class="number">2</span>]))</span><br><span class="line"><span class="comment"># 将结果存到SeqResult中</span></span><br><span class="line">SeqResult = SeqCache</span><br><span class="line"><span class="built_in">print</span>(<span class="string">&quot;当前录入人员：===&gt; &quot;</span>,SeqResult[<span class="string">&#x27;姓名&#x27;</span>].values,<span class="string">&quot;&lt;===&quot;</span>)</span><br><span class="line"><span class="comment"># 询问是否继续添加,对输入值进行控制</span></span><br><span class="line">BreakInput = <span class="built_in">input</span>(<span class="string">&quot;是否继续添加,YES OR NO :\n&quot;</span>)</span><br><span class="line"><span class="keyword">while</span> BreakInput.upper() <span class="keyword">not</span> <span class="keyword">in</span> [<span class="string">&quot;YES&quot;</span>, <span class="string">&quot;NO&quot;</span>]:</span><br><span class="line">    BreakInput = <span class="built_in">input</span>(<span class="string">&quot;输入错误,请重新输入\n是否继续添加,YES OR NO :\n&quot;</span>)</span><br><span class="line">BreakKey = BreakInput.upper() <span class="comment">#规范化输入为大写</span></span><br><span class="line"><span class="comment">#===============================是否继续添加====================</span></span><br><span class="line"><span class="comment"># 使用While循环结构实现反复问询是否继续添加</span></span><br><span class="line"><span class="keyword">while</span> BreakKey == <span class="string">&quot;YES&quot;</span> :</span><br><span class="line">    <span class="comment"># 输入需要查询的列值信息及所需数量，如&quot;职业资格名称1，测绘作业证，3&quot;</span></span><br><span class="line">    SeqInput = <span class="built_in">input</span>(<span class="string">&quot;请输入需要查询的列值信息及所需数量:\n&quot;</span>)</span><br><span class="line">    <span class="comment"># 考虑到输入习惯，用中文逗号做分割</span></span><br><span class="line">    SeqKey = SeqInput.split(<span class="string">&quot;，&quot;</span>)</span><br><span class="line">    <span class="comment"># 判断职业资格名称1是否为测绘作业证</span></span><br><span class="line">    SeqCache = DataSource[DataSource[SeqKey[<span class="number">0</span>]].isin([SeqKey[<span class="number">1</span>]])].head(<span class="built_in">int</span>(SeqKey[<span class="number">2</span>]))</span><br><span class="line">    <span class="comment"># 新增的数据行应该实现和已有数据行的有机合并，所以需要去重,去重后合并的结果保存到SeqResult中</span></span><br><span class="line">    SeqResult = pd.concat([SeqResult , SeqCache] , ignore_index=<span class="literal">False</span>).drop_duplicates()</span><br><span class="line">    <span class="built_in">print</span>(<span class="string">&quot;当前录入人员：===&gt; &quot;</span>,SeqResult[<span class="string">&#x27;姓名&#x27;</span>].values,<span class="string">&quot;&lt;===&quot;</span>)</span><br><span class="line">    BreakInput = <span class="built_in">input</span>(<span class="string">&quot;是否继续添加,YES OR NO :  &quot;</span>)</span><br><span class="line">    <span class="keyword">while</span> BreakInput.upper() <span class="keyword">not</span> <span class="keyword">in</span> [<span class="string">&quot;YES&quot;</span>, <span class="string">&quot;NO&quot;</span>]:</span><br><span class="line">        BreakInput = <span class="built_in">input</span>(<span class="string">&quot;输入错误,请重新输入\n是否继续添加,YES OR NO :  &quot;</span>)</span><br><span class="line">    BreakKey = BreakInput.upper() <span class="comment">#规范化输入为大写</span></span><br><span class="line">SeqResult=SeqResult.reset_index(drop=<span class="literal">True</span>) <span class="comment">#重置索引值</span></span><br><span class="line"><span class="comment">#=======================纵向裁剪切片====================</span></span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;=&#x27;</span> * <span class="number">80</span>)</span><br><span class="line">HeaderListInput = <span class="built_in">input</span>(<span class="string">&quot;请输入需要选用的列名，\n例如： 姓名，学历，专业，学校，身份证号码，合同编号，手机\n请输入需要选用的列名：\n&quot;</span>)</span><br><span class="line"><span class="comment"># 考虑到输入习惯，用中文逗号做分割，转为list存放到HeaderList变量中</span></span><br><span class="line">HeaderList = HeaderListInput.split(<span class="string">&quot;，&quot;</span>)</span><br><span class="line"><span class="comment"># 根据指定列名保留需要的列，剔除冗余的列，完成纵向裁剪切片,结果保存到SeqResult中</span></span><br><span class="line">SeqResult=SeqResult.loc[:,HeaderList]</span><br><span class="line"></span><br><span class="line"><span class="comment">#===================输出保存至文件===========</span></span><br><span class="line"><span class="built_in">print</span>(<span class="string">&quot;正在根据您所输入的列名进行重新排版......\n以下是待保存的数据预览:\n&quot;</span>)</span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;-&#x27;</span> * <span class="number">80</span>)</span><br><span class="line"><span class="built_in">print</span>(SeqResult)</span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;-&#x27;</span> * <span class="number">80</span>)</span><br><span class="line">SaveFile = <span class="built_in">input</span>(<span class="string">&quot;信息整合完毕，请输入您想要保存的文件名:\n例如：test.xlsx\n&quot;</span>)</span><br><span class="line"><span class="comment"># 按文件名将切片结果保存到文件中</span></span><br><span class="line">SeqResult.to_excel(SaveFile, index=<span class="literal">False</span>)</span><br></pre></td></tr></table></figure><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div></div></div><h2 id="实例2——简历表自动生成"><a href="#实例2——简历表自动生成" class="headerlink" title="实例2——简历表自动生成"></a>实例2——简历表自动生成</h2><ol><li>第一步，要把实例1导出的人员信息进行导入，这部分的代码可以参考实例1，复用导入的代码。</li><li>第二步，因为目标是根据人员信息生成简历表，所以需要一个简历表的模板。<span class="hidden-anchor" id="referto_[2]"></span><sup class="reference"><a href="#referfrom_[2]">[2]</a></sup><span class="reference-bubble"><span class="reference-item"><span class="reference-literature">蜗牛壳上的小潘同志.CSDN——PYTHON将EXCEL数据自动填充到WORD指定位置中</span><span class="reference-title">参考资料</span></span></span></li><li>第三步，根据简历模板生成简历，需要将人员信息和模板中需要填写的内容联系起来。此处在已经找到参考示例的情况下，拟采用手动输入变量和列名的列表，然后依次匹配生成。</li><li>第四步，照例是根据输入的文件名保存文件。</li><li>由此确认了最初的输入输出框架：<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">&quot;&quot;&quot;</span></span><br><span class="line"><span class="string">输入示例：</span></span><br><span class="line"><span class="string">OUT:请输入简历数据源</span></span><br><span class="line"><span class="string">IN:test.xlsx</span></span><br><span class="line"><span class="string">OUT:已导入数据源</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">OUT:请输入简历模板：</span></span><br><span class="line"><span class="string">IN:简历模板.doc</span></span><br><span class="line"><span class="string">OUT:已导入简历模板</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">OUT:请输入模板变量的信息，按顺序输入，以&quot;,&quot;分割。</span></span><br><span class="line"><span class="string">IN:name,ID,Certificate,University,graduate,phone</span></span><br><span class="line"><span class="string">OUT:请输入数据源中对应模板变量的列名，按顺序输入，以“，”分割</span></span><br><span class="line"><span class="string">IN: 姓名，身份证号码，资质证书，毕业学校，毕业时间，手机号码</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">OUT:已生成简历表，请输入存放文件的名字</span></span><br><span class="line"><span class="string">IN:简历表.doc</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">OUT:已完成导出</span></span><br><span class="line"><span class="string">&quot;&quot;&quot;</span></span><br></pre></td></tr></table></figure><h3 id="编写过程梳理-1"><a href="#编写过程梳理-1" class="headerlink" title="编写过程梳理"></a>编写过程梳理</h3><div class="tabs" id="简历表生成"><ul class="nav-tabs"><li class="tab active"><button type="button" data-href="#简历表生成-1">流程图</button></li><li class="tab"><button type="button" data-href="#简历表生成-2">代码框架</button></li><li class="tab"><button type="button" data-href="#简历表生成-3">思维导图罗列问题</button></li><li class="tab"><button type="button" data-href="#简历表生成-4">补充提示文字</button></li><li class="tab"><button type="button" data-href="#简历表生成-5">程序源码</button></li></ul><div class="tab-contents"><div class="tab-item-content active" id="简历表生成-1"><p>根据设计好的输入输出示例，我画出了相应的流程图<br><img src="" data-lazy-src="https://npm.elemecdn.com/akilar-candyassets/image/resumegenerate.png" alt=""></p><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div><div class="tab-item-content" id="简历表生成-2"><p>然后在流程图基础上罗列出基本的代码框架<br></p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># ====================加载简历表信息数据源====================</span></span><br><span class="line">DataSourceInput = <span class="built_in">input</span>(<span class="string">&quot;请输入简历数据源：&quot;</span>);</span><br><span class="line">DataSource = ...</span><br><span class="line"><span class="comment"># <span class="doctag">TODO:</span>导入简历表数据源，可以参考实例1</span></span><br><span class="line"><span class="comment">#  ====================加载简历表模板 ====================</span></span><br><span class="line">TemplateInput = <span class="built_in">input</span>(<span class="string">&quot;请输入简历模板：&quot;</span>);</span><br><span class="line">Template = ...</span><br><span class="line"><span class="comment"># <span class="doctag">TODO:</span>导入简历表模板</span></span><br><span class="line"></span><br><span class="line"><span class="comment">#  ====================将模板中的变量与数据源中的人员信息一一匹配 ====================</span></span><br><span class="line">VarListInput = <span class="built_in">input</span>(<span class="string">&quot;请输入模板变量的信息，按顺序输入，以英文逗号“,”分割&quot;</span>)</span><br><span class="line">HeaderlistInput = <span class="built_in">input</span>(<span class="string">&quot;请输入数据源中对应模板变量的列名，与上述模板变量对应，以中文逗号“，”分割&quot;</span>)</span><br><span class="line"><span class="comment"># <span class="doctag">TODO:</span> 对输入的字符串进行分割，转为列表list，便于读取操作</span></span><br><span class="line"><span class="comment"># <span class="doctag">TODO:</span> 安装Varlist中的变量名和Headerlist中的对应列一一赋值匹配并保存。</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># ====================批量渲染简历表 ====================</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># TODO：根据模板依次渲染</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># ====================保存生成的简历表到文件 ====================</span></span><br><span class="line">SaveFile = <span class="built_in">input</span>(<span class="string">&quot;请输入您想要保存的文件名:&quot;</span>)</span><br><span class="line"><span class="comment"># <span class="doctag">TODO:</span>保存文件</span></span><br></pre></td></tr></table></figure><p></p><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div><div class="tab-item-content" id="简历表生成-3"><p>根据代码框架，罗列TODO，并根据自己对python中列表、字典等数据结构的了解和条件、分支、循环等语句的运用，提取相应的搜索关键词，确定搜索方向。<br><img src="" data-lazy-src="https://npm.elemecdn.com/akilar-candyassets/image/resumegenerate_xmind.png" alt=""></p><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div><div class="tab-item-content" id="简历表生成-4"><p>因为要考虑到使用者的具体感受，所以推荐在解决了<code>TODO</code>以后，再通过<code>print()</code>函数写一些提示性文字，提示输入示例，引导输入。<br></p><figure class="highlight diff"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br></pre></td><td class="code"><pre><span class="line">  from docxtpl import DocxTemplate</span><br><span class="line">  # docx-template是一个使用jinjia2方法渲染docx文件的包。</span><br><span class="line">  # 这个包通过对docx模板中 &#123;&#123; var &#125;&#125; 的处理，实现模块化、自动化的处理word文件。</span><br><span class="line">  import pandas as pd</span><br><span class="line">  pd.set_option(&#x27;display.float_format&#x27;,lambda x : &#x27;%d&#x27; % x) #禁用科学计数法</span><br><span class="line">  from pandas import Series, DataFrame</span><br><span class="line">  # pandas包用于对excel文件进行读取和行列操作。</span><br><span class="line">  from docx import Document</span><br><span class="line">  from docxcompose.composer import Composer</span><br><span class="line">  # 使⽤python-docx扩展库和docxcompose扩展库实现简历表合并</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">  # <span class="comment">====================加载简历表信息数据源====================</span></span><br><span class="line">  DataSourceInput = input(&quot;请输入简历数据源：\n例如： test.xlsx  \n&quot;);</span><br><span class="line">  print(&#x27;文件:&#x27;, DataSourceInput, &#x27;加载中......&#x27;)</span><br><span class="line">  DataSource = pd.read_excel(DataSourceInput)</span><br><span class="line"><span class="addition">+ print(&#x27;已导入数据源&#x27;)</span></span><br><span class="line"><span class="addition">+ print(&#x27;=&#x27; * 80)</span></span><br><span class="line"><span class="addition">+ print(&#x27;数据源:&#x27;,DataSourceInput,&#x27;预览&#x27;)</span></span><br><span class="line"><span class="addition">+ print(DataSource)</span></span><br><span class="line"><span class="addition">+ print(&#x27;=&#x27; * 80)</span></span><br><span class="line">  #  <span class="comment">====================加载简历表模板 ====================</span></span><br><span class="line">  TemplateInput = input(&quot;请输入简历模板：\n例如： 简历表模板.docx\n&quot;);</span><br><span class="line"><span class="addition">+ print(&#x27;简历模板:&#x27;, TemplateInput, &#x27;加载中......&#x27;)</span></span><br><span class="line">  Template = DocxTemplate(TemplateInput)</span><br><span class="line"><span class="addition">+ print(&#x27;已导入简历模板&#x27;)</span></span><br><span class="line"><span class="addition">+ print(&#x27;=&#x27; * 80)</span></span><br><span class="line">  #  <span class="comment">====================将模板中的变量与数据源中的人员信息一一匹配 ====================</span></span><br><span class="line"><span class="deletion">- VarListInput = input(&quot;请输入模板变量的信息：&quot;)</span></span><br><span class="line"><span class="addition">+ VarListInput = input(&quot;请输入模板变量的信息，按顺序输入，以英文逗号“,”分割\n例如：name,ID,Certificate,University,graduate,phone\n&quot;)</span></span><br><span class="line"><span class="addition">+ print(&#x27;=&#x27; * 80)</span></span><br><span class="line"></span><br><span class="line"><span class="deletion">- HeaderlistInput = input(&quot;请输入数据源中对应模板变量的列名：&quot;)</span></span><br><span class="line"><span class="addition">+ HeaderlistInput = input(&quot;请输入数据源中对应模板变量的列名，与上述模板变量对应，以中文逗号“，”分割\n例如： 姓名，身份证号码，资质证书，毕业学校，毕业时间，手机号码\n&quot;)</span></span><br><span class="line"><span class="addition">+ print(&#x27;=&#x27; * 80)</span></span><br><span class="line"></span><br><span class="line">  VarList = VarListInput.split(&quot;,&quot;) #出于输入习惯，变量为英文，所以用英文逗号分割</span><br><span class="line">  Headerlist = HeaderlistInput.split(&quot;，&quot;) #出于输入习惯，对应列名为英文，所以用英文逗号分割</span><br><span class="line"></span><br><span class="line"><span class="addition">+ print(&quot;变量参数录入完成，正在根据参数键值对生成简历信息&quot;)</span></span><br><span class="line"></span><br><span class="line">  contexts = [] #存放生成的所有简历信息和对应值字典的列表容器</span><br><span class="line">  for row in range(DataSource.shape[0]): #一重循环，读取数据源的每行信息</span><br><span class="line">      context = &#123;&#125; #生成的单人简历信息和对应值</span><br><span class="line">      for i in range(len(VarList)): #二重循环，将数据源中的人员信息赋值给存放单人简历信息的context字典</span><br><span class="line">          context[VarList[i]] = DataSource.loc[row,Headerlist[i]]</span><br><span class="line"><span class="addition">+     print(context)</span></span><br><span class="line">      contexts.append(context) #将赋值完毕的单人简历信息放入存放所以简历信息的列表</span><br><span class="line"></span><br><span class="line">  # <span class="comment">====================批量渲染简历表 ====================</span></span><br><span class="line"><span class="addition">+ print(&#x27;=&#x27; * 80)</span></span><br><span class="line">  # 根据模板依次渲染</span><br><span class="line"><span class="addition">+ print(&quot;正在根据简历信息及模板渲染简历表......&quot;)</span></span><br><span class="line">  # 新建一个doc文件，用于存放生成的简历表</span><br><span class="line">  new_document = Document() #空doc文件</span><br><span class="line">  composer = Composer(new_document) #预备用于存放生成的简历表的doc容器，使用Composer函数实例化。</span><br><span class="line"></span><br><span class="line">  for context in contexts: #依次读取contexts中的每个context单人简历数据字典</span><br><span class="line">      Template.render(context) #根据键值对渲染简历表</span><br><span class="line">      composer.append(Template) #将渲染好的简历表合并到composer</span><br><span class="line">  # <span class="comment">====================保存生成的简历表到文件 ====================</span></span><br><span class="line"><span class="deletion">- SaveFile = input(&quot;请输入您想要保存的文件名:&quot;)</span></span><br><span class="line"><span class="addition">+ SaveFile = input(&quot;生成完毕，请输入您想要保存的文件名:\n例如：test.docx\n&quot;)</span></span><br><span class="line">  composer.save(SaveFile) #保存合并好的简历表</span><br><span class="line"><span class="addition">+ print(&#x27;文件:&#x27;, SaveFile , &#x27;已保存&#x27;)</span></span><br><span class="line"></span><br></pre></td></tr></table></figure><p></p><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div><div class="tab-item-content" id="简历表生成-5"><div class="table-container"><table><thead><tr><th style="text-align:left">变量名</th><th style="text-align:left">数据类型</th><th style="text-align:left">变量释义</th></tr></thead><tbody><tr><td style="text-align:left">DataSourceInput</td><td style="text-align:left">字符串string</td><td style="text-align:left">输入的简历表数据源文件名</td></tr><tr><td style="text-align:left">DataSource</td><td style="text-align:left">二维数据表结构DataFrame</td><td style="text-align:left">根据文件名获取简历表数据源后存放于此变量</td></tr><tr><td style="text-align:left">TemplateInput</td><td style="text-align:left">字符串string</td><td style="text-align:left">输入的简历表模板文件名</td></tr><tr><td style="text-align:left">Template</td><td style="text-align:left">模板文件</td><td style="text-align:left">docxtpl包特有的模板数据结构，仅用于渲染</td></tr><tr><td style="text-align:left">VarListInput</td><td style="text-align:left">字符串String</td><td style="text-align:left">模板文件中的变量的信息</td></tr><tr><td style="text-align:left">HeaderlistInput</td><td style="text-align:left">字符串String</td><td style="text-align:left">简历表数据源中与模板文件内变量对应的表头</td></tr><tr><td style="text-align:left">VarList</td><td style="text-align:left">列表list</td><td style="text-align:left">将VarListInput按英文逗号“,”分割后获得的列表，便于操作</td></tr><tr><td style="text-align:left">HeaderList</td><td style="text-align:left">列表list</td><td style="text-align:left">将HeaderListInput按中文逗号“，”分割后获得的列表，便于操作</td></tr><tr><td style="text-align:left">context</td><td style="text-align:left">字典dict</td><td style="text-align:left">个人简历表的键值对信息，形如<code>{&#39;name&#39;:姓名,&#39;age&#39;:年龄,&#39;education&#39;:学历}</code></td></tr><tr><td style="text-align:left">contexts</td><td style="text-align:left">列表list</td><td style="text-align:left">存放配对完毕的个人简历表字典的容器</td></tr><tr><td style="text-align:left">SaveFile</td><td style="text-align:left">字符串String</td><td style="text-align:left">存放切片结果的文件的名字</td></tr></tbody></table></div><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> docxtpl <span class="keyword">import</span> DocxTemplate</span><br><span class="line"><span class="comment"># docx-template是一个使用jinjia2方法渲染docx文件的包。</span></span><br><span class="line"><span class="comment"># 这个包通过对docx模板中 &#123;&#123; var &#125;&#125; 的处理，实现模块化、自动化的处理word文件。</span></span><br><span class="line"><span class="keyword">import</span> pandas <span class="keyword">as</span> pd</span><br><span class="line">pd.set_option(<span class="string">&#x27;display.float_format&#x27;</span>,<span class="keyword">lambda</span> x : <span class="string">&#x27;%d&#x27;</span> % x) <span class="comment">#禁用科学计数法</span></span><br><span class="line"><span class="keyword">from</span> pandas <span class="keyword">import</span> Series, DataFrame</span><br><span class="line"><span class="comment"># pandas包用于对excel文件进行读取和行列操作。</span></span><br><span class="line"><span class="keyword">from</span> docx <span class="keyword">import</span> Document</span><br><span class="line"><span class="keyword">from</span> docxcompose.composer <span class="keyword">import</span> Composer</span><br><span class="line"><span class="comment"># 使⽤python-docx扩展库和docxcompose扩展库实现简历表合并</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># ====================加载简历表信息数据源====================</span></span><br><span class="line">DataSourceInput = <span class="built_in">input</span>(<span class="string">&quot;请输入简历数据源：\n例如： test.xlsx  \n&quot;</span>);</span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;文件:&#x27;</span>, DataSourceInput, <span class="string">&#x27;加载中......&#x27;</span>)</span><br><span class="line">DataSource = pd.read_excel(DataSourceInput)</span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;已导入数据源&#x27;</span>)</span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;=&#x27;</span> * <span class="number">80</span>)</span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;数据源:&#x27;</span>,DataSourceInput,<span class="string">&#x27;预览&#x27;</span>)</span><br><span class="line"><span class="built_in">print</span>(DataSource)</span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;=&#x27;</span> * <span class="number">80</span>)</span><br><span class="line"><span class="comment">#  ====================加载简历表模板 ====================</span></span><br><span class="line">TemplateInput = <span class="built_in">input</span>(<span class="string">&quot;请输入简历模板：\n例如： 简历表模板.docx\n&quot;</span>);</span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;简历模板:&#x27;</span>, TemplateInput, <span class="string">&#x27;加载中......&#x27;</span>)</span><br><span class="line">Template = DocxTemplate(TemplateInput)</span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;已导入简历模板&#x27;</span>)</span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;=&#x27;</span> * <span class="number">80</span>)</span><br><span class="line"><span class="comment">#  ====================将模板中的变量与数据源中的人员信息一一匹配 ====================</span></span><br><span class="line">VarListInput = <span class="built_in">input</span>(<span class="string">&quot;请输入模板变量的信息，按顺序输入，以英文逗号“,”分割\n例如：name,ID,Certificate,University,graduate,phone\n&quot;</span>)</span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;=&#x27;</span> * <span class="number">80</span>)</span><br><span class="line"></span><br><span class="line">HeaderlistInput = <span class="built_in">input</span>(<span class="string">&quot;请输入数据源中对应模板变量的列名，与上述模板变量对应，以中文逗号“，”分割\n例如： 姓名，身份证号码，资质证书，毕业学校，毕业时间，手机号码\n&quot;</span>)</span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;=&#x27;</span> * <span class="number">80</span>)</span><br><span class="line"></span><br><span class="line">VarList = VarListInput.split(<span class="string">&quot;,&quot;</span>) <span class="comment">#出于输入习惯，变量为英文，所以用英文逗号分割</span></span><br><span class="line">Headerlist = HeaderlistInput.split(<span class="string">&quot;，&quot;</span>) <span class="comment">#出于输入习惯，对应列名为英文，所以用英文逗号分割</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">print</span>(<span class="string">&quot;变量参数录入完成，正在根据参数键值对生成简历信息&quot;</span>)</span><br><span class="line"></span><br><span class="line">contexts = [] <span class="comment">#存放生成的所有简历信息和对应值字典的列表容器</span></span><br><span class="line"><span class="keyword">for</span> row <span class="keyword">in</span> <span class="built_in">range</span>(DataSource.shape[<span class="number">0</span>]): <span class="comment">#一重循环，读取数据源的每行信息</span></span><br><span class="line">    context = &#123;&#125; <span class="comment">#生成的单人简历信息和对应值</span></span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(VarList)): <span class="comment">#二重循环，将数据源中的人员信息赋值给存放单人简历信息的context字典</span></span><br><span class="line">        context[VarList[i]] = DataSource.loc[row,Headerlist[i]]</span><br><span class="line">    <span class="built_in">print</span>(context)</span><br><span class="line">    contexts.append(context) <span class="comment">#将赋值完毕的单人简历信息放入存放所以简历信息的列表</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># ====================批量渲染简历表 ====================</span></span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;=&#x27;</span> * <span class="number">80</span>)</span><br><span class="line"><span class="comment"># 根据模板依次渲染</span></span><br><span class="line"><span class="built_in">print</span>(<span class="string">&quot;正在根据简历信息及模板渲染简历表......&quot;</span>)</span><br><span class="line"><span class="comment"># 新建一个doc文件，用于存放生成的简历表</span></span><br><span class="line">new_document = Document() <span class="comment">#空doc文件</span></span><br><span class="line">composer = Composer(new_document) <span class="comment">#预备用于存放生成的简历表的doc容器，使用Composer函数实例化。</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> context <span class="keyword">in</span> contexts: <span class="comment">#依次读取contexts中的每个context单人简历数据字典</span></span><br><span class="line">    Template.render(context) <span class="comment">#根据键值对渲染简历表</span></span><br><span class="line">    composer.append(Template) <span class="comment">#将渲染好的简历表合并到composer</span></span><br><span class="line"><span class="comment"># ====================保存生成的简历表到文件 ====================</span></span><br><span class="line">SaveFile = <span class="built_in">input</span>(<span class="string">&quot;生成完毕，请输入您想要保存的文件名:\n例如：test.docx\n&quot;</span>)</span><br><span class="line">composer.save(SaveFile) <span class="comment">#保存合并好的简历表</span></span><br><span class="line"><span class="built_in">print</span>(<span class="string">&#x27;文件:&#x27;</span>, SaveFile , <span class="string">&#x27;已保存&#x27;</span>)</span><br></pre></td></tr></table></figure><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div></div></div></li></ol><h2 id="搜索思路"><a href="#搜索思路" class="headerlink" title="搜索思路"></a>搜索思路</h2><ol><li><p>罗列出代码框架后，根据已经提出的需要解决的问题，也就是注释中的<strong>TODO</strong>，这个就需要在了解python<strong>基本的数据结构和条件、循环及其他语句</strong>的前提下，列出搜索的方向。</p></li><li><p>搜索的方向需要活用提炼出的<span class="bubble-content">技术栈</span><span class="bubble-notation"><span class="bubble-item" style="background-color:#71a4e3">技术栈，IT术语，某项工作或某个职位需要掌握的一系列技能组合的统称。</span></span>，通过必要的技术栈来查找<em>需要的第三方库，别人写好的示例代码，可行的数据操作方向</em>。</p></li><li><p>以实例一中的“TODO:获取列名为职业资格名称1的列的所有值，保留职业资格名称1为测绘作业证的前几项”这个问题为例，首先搜索<code>python excel 数据处理</code>，搜索到的结果推荐我使用openpyxl<span class="hidden-anchor" id="referto_[3]"></span><sup class="reference"><a href="#referfrom_[3]">[3]</a></sup><span class="reference-bubble"><span class="reference-item"><span class="reference-literature">使用Python自动化Microsoft Excel和Word</span><span class="reference-title">参考资料</span></span></span>、xlrd<span class="hidden-anchor" id="referto_[4]"></span><sup class="reference"><a href="#referfrom_[4]">[4]</a></sup><span class="reference-bubble"><span class="reference-item"><span class="reference-literature">solocoder.简书——Python数据处理（二）：处理 Excel 数据[OL]，2019-02-16</span><span class="reference-title">参考资料</span></span></span>、xlwings<span class="hidden-anchor" id="referto_[5]"></span><sup class="reference"><a href="#referfrom_[5]">[5]</a></sup><span class="reference-bubble"><span class="reference-item"><span class="reference-literature">zcdmw.知乎专栏——xlwings最全操作；10秒搞定Xlwings全套操作[OL]，2020-09-12</span><span class="reference-title">参考资料</span></span></span>、pandas<span class="hidden-anchor" id="referto_[6]"></span><sup class="reference"><a href="#referfrom_[6]">[6]</a></sup><span class="reference-bubble"><span class="reference-item"><span class="reference-literature">HelenLee.博客园——【python】读取excel的行列内容，pandas，超详细！！！[OL]，2020-03-02</span><span class="reference-title">参考资料</span></span></span>这些第三方包库。</p></li><li><p>根据形似关键词<code>python &quot;excel&quot; &quot;openpyxl&quot; 数据处理</code>搜到的参考资料和给出的参考示例，最终我是确认用<code>pandas</code>比较方便。（此处用到了一些<a target="_blank" rel="noopener external nofollow noreferrer" href="https://zhuanlan.zhihu.com/p/349614983">基础的搜索引擎语法</a>，用引号包裹<span class="hidden-anchor" id="referto_[7]"></span><sup class="reference"><a href="#referfrom_[7]">[7]</a></sup><span class="reference-bubble"><span class="reference-item"><span class="reference-literature">黑客老鸟-五竹.知乎——搜索引擎实用语法[OL]，2021-02-06</span><span class="reference-title">参考资料</span></span></span>要确保存在于搜索结果中的必要技术栈）</p></li><li><p>然后进一步界定技术栈，继续搜索，<code>pandas excel 数据处理</code>。</p></li><li><p>搜索过程中要多优化搜索方向，确定指定的技术内容，之后可以搜索<code>pandas excel 指定位置数据</code>、<code>pandas excel 行列操作</code>、<code>pandas DataFrame 去重 合并</code>等。</p></li><li>当确定了使用的包库，并且找到了相应的案例以后，下一步就是进一步了解案例中用到的函数方法。比如我在两个实例里用到的<span class="bubble-content">isin()方法</span><span class="bubble-notation"><span class="bubble-item" style="background-color:#3e3e3e">主要用于确认数据集中的数值是否被包含在给定的列表中。</span></span>、<span class="bubble-content">append()方法</span><span class="bubble-notation"><span class="bubble-item" style="background-color:#193954">主要用于在现有数据上追加新的数据对象，例如数据合并操作。</span></span>，了解这些函数方法的具体参数，用这些已经封装好的函数方法去完成我们期望的一些复杂操作。</li></ol><div class="note blue icon-padding simple"><i class="note-icon fas fa-bullhorn"></i><p>注意事项：</p><ul><li>在查找解决方案时尽量避免抱着一蹴而就的心态，想着直接找到别人做好的轮子，虽然偶尔确实会有，比如在找简历表生成示例时,根据关键词<code>python excel word 自动化</code>，搜到了<a target="_blank" rel="noopener external nofollow noreferrer" href="https://blog.csdn.net/qq_40235133/article/details/108762855">PYTHON将EXCEL数据自动填充到WORD指定位置中</a></li><li>不能依赖于运气，查找方向应该以别人整理好的归纳性的示例为主，比如根据关键词<code>pandas excel 行列读取</code>搜到了<a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.cnblogs.com/helenlee01/p/12617481.html">【python】读取excel的行列内容，pandas，超详细！！！</a>，这篇里就提供了各种读取指定行，指定列，多行多列，特定行列的方法。</li><li><p>如果根据关键词实在查不到现成的示例，那就只能学习一下所需第三方包库的具体用法了，比如根据关键词<code>pandas 中文文档</code>搜索<a target="_blank" rel="noopener external nofollow noreferrer" href="http://www.pypandas.cn/docs/getting_started/10min.html">十分钟入门 Pandas</a></p></li><li><p>搜索时要注意看参考文章的发布时间，因为python的第三方包库是日新月异的，可能以前比较好用的包库，现在已经有了更好用的替代品。也可能旧版的包库不兼容于最新版的python，这会间接导致遇到一些兼容性报错。<strong>结合文章发布时间选择更新的技术</strong>是大势所趋。</p></li><li>查阅的参考教程以<strong>知乎、掘金、博客园</strong>等为优先，这些网站的原创程度高，排版也较好。尽量<strong>避免参考CSDN、简书、腾讯云社区</strong>等，这些网站的文章部分是通过爬虫爬取或者第三方推送的方式发布的，抛开盗版这个话题不谈，爬虫获取的文章极大概率存在排版错乱问题，而python语法中，缩进是有具体含义的，排版混乱会直接导致python代码无法正常运行。</li></ul></div><h2 id="扩展内容"><a href="#扩展内容" class="headerlink" title="扩展内容"></a>扩展内容</h2><p>此项主要是简单讲解一下如何将编写好的python程序（.py后缀）打包为可执行文件（.exe后缀）。<br>其实就两行代码。</p><ol><li>安装<a target="_blank" rel="noopener external nofollow noreferrer" href="http://www.pyinstaller.org/">pyinstaller</a>,在任意位置打开终端，输入指令安装<span class="hidden-anchor" id="referto_[8]"></span><sup class="reference"><a href="#referfrom_[8]">[8]</a></sup><span class="reference-bubble"><span class="reference-item"><span class="reference-literature">鱼丸丶粗面 .脚本之家——Python打包为exe详细教程[OL]，2021-05-18</span><span class="reference-title">参考资料</span></span></span>：<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pip install pyinstaller</span><br></pre></td></tr></table></figure></li><li>在写好的python程序同级目录打开终端，运行指令，其中<code>test.py</code>为待打包的python程序。<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pyinstaller.exe -F .\test.py</span><br></pre></td></tr></table></figure></li><li>在实例二的打包过程中，遇到了缺少docxcompose/templates/custom.xml的报错。需要通过—add-path参数将缺少的文件导进去<span class="hidden-anchor" id="referto_[9]"></span><sup class="reference"><a href="#referfrom_[9]">[9]</a></sup><span class="reference-bubble"><span class="reference-item"><span class="reference-literature">lsyoulin .灰信网——用PYTHON实现WORD多文档合并[OL]，2020-07-07</span><span class="reference-title">参考资料</span></span></span>。查找到我的custom.xml文件在<code>D:\ProgramData\Anaconda3\Lib\site-packages\docxcompose\templates\custom.xml</code>,<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pyinstaller -F --add-data D:\ProgramData\Anaconda3\Lib\site-packages\docxcompose\templates\*.*;docxcompose\templates\. .\test.py</span><br></pre></td></tr></table></figure></li></ol><h2 id="参考文献"><a href="#参考文献" class="headerlink" title="参考文献"></a>参考文献</h2><div class="reference-source"><span class="hidden-anchor" id="referfrom_[1]"></span><a class="reference-anchor" href="#referto_[1]">[1]<div class="reference-anchor-up fa-solid fa-angles-up"></div></a><a class="reference-link" target="_blank" rel="noopener external nofollow noreferrer" href="https://zhuanlan.zhihu.com/p/428854223">小白师哥.知乎——python为什么更适用于AI[OL]，2021-11-03</a></div><div class="reference-source"><span class="hidden-anchor" id="referfrom_[2]"></span><a class="reference-anchor" href="#referto_[2]">[2]<div class="reference-anchor-up fa-solid fa-angles-up"></div></a><a class="reference-link" target="_blank" rel="noopener external nofollow noreferrer" href="https://blog.csdn.net/qq_40235133/article/details/108762855">蜗牛壳上的小潘同志.CSDN——PYTHON将EXCEL数据自动填充到WORD指定位置中</a></div><div class="reference-source"><span class="hidden-anchor" id="referfrom_[3]"></span><a class="reference-anchor" href="#referto_[3]">[3]<div class="reference-anchor-up fa-solid fa-angles-up"></div></a><a class="reference-link" target="_blank" rel="noopener external nofollow noreferrer" href="https://zhuanlan.zhihu.com/p/365538106">deephub.知乎专栏——使用Python自动化Microsoft Excel和Word[OL]，2021-04-17</a></div><div class="reference-source"><span class="hidden-anchor" id="referfrom_[4]"></span><a class="reference-anchor" href="#referto_[4]">[4]<div class="reference-anchor-up fa-solid fa-angles-up"></div></a><a class="reference-link" target="_blank" rel="noopener external nofollow noreferrer" href="https://www.jianshu.com/p/7546f4bd2b8a">solocoder.简书——Python数据处理（二）：处理 Excel 数据[OL]，2019-02-16</a></div><div class="reference-source"><span class="hidden-anchor" id="referfrom_[5]"></span><a class="reference-anchor" href="#referto_[5]">[5]<div class="reference-anchor-up fa-solid fa-angles-up"></div></a><a class="reference-link" target="_blank" rel="noopener external nofollow noreferrer" href="https://zhuanlan.zhihu.com/p/237583143">zcdmw.知乎专栏——xlwings最全操作；10秒搞定Xlwings全套操作[OL]，2020-09-12</a></div><div class="reference-source"><span class="hidden-anchor" id="referfrom_[6]"></span><a class="reference-anchor" href="#referto_[6]">[6]<div class="reference-anchor-up fa-solid fa-angles-up"></div></a><a class="reference-link" target="_blank" rel="noopener external nofollow noreferrer" href="https://www.cnblogs.com/helenlee01/p/12617481.html">HelenLee.博客园——【python】读取excel的行列内容，pandas，超详细！！！[OL]，2020-03-02</a></div><div class="reference-source"><span class="hidden-anchor" id="referfrom_[7]"></span><a class="reference-anchor" href="#referto_[7]">[7]<div class="reference-anchor-up fa-solid fa-angles-up"></div></a><a class="reference-link" target="_blank" rel="noopener external nofollow noreferrer" href="https://zhuanlan.zhihu.com/p/349614983">黑客老鸟-五竹.知乎——搜索引擎实用语法[OL]，2021-02-06</a></div><div class="reference-source"><span class="hidden-anchor" id="referfrom_[8]"></span><a class="reference-anchor" href="#referto_[8]">[8]<div class="reference-anchor-up fa-solid fa-angles-up"></div></a><a class="reference-link" target="_blank" rel="noopener external nofollow noreferrer" href="https://www.jb51.net/article/212597.htm">鱼丸丶粗面.脚本之家——Python打包为exe详细教程[OL]，2021-05-18</a></div><div class="reference-source"><span class="hidden-anchor" id="referfrom_[9]"></span><a class="reference-anchor" href="#referto_[9]">[9]<div class="reference-anchor-up fa-solid fa-angles-up"></div></a><a class="reference-link" target="_blank" rel="noopener external nofollow noreferrer" href="https://www.freesion.com/article/4269991136/">lsyoulin .灰信网——用PYTHON实现WORD多文档合并[OL]，2020-07-07</a></div></article><div class="post-copyright"><div class="post-copyright__title"><span class="post-copyright-info"><h>python自动化办公实例</h></span></div><div class="post-copyright__type"><span class="post-copyright-info"><a href="https://akilar.top/posts/58249fc9/">https://akilar.top/posts/58249fc9/</a></span></div><div class="post-copyright-m"><div class="post-copyright-m-info"><div class="post-copyright-a"><h>作者</h><div class="post-copyright-cc-info"><h>Akilar</h></div></div><div class="post-copyright-c"><h>发布于</h><div class="post-copyright-cc-info"><h>2022-05-16</h></div></div><div class="post-copyright-u"><h>更新于</h><div class="post-copyright-cc-info"><h>2022-06-23</h></div></div><div class="post-copyright-c"><h>许可协议</h><div class="post-copyright-cc-info"><a class="icon" rel="noopener external nofollow noreferrer" target="_blank" title="Creative Commons" href="https://creativecommons.org/"><i class="fab fa-creative-commons"></i></a><a rel="noopener external nofollow noreferrer" target="_blank" title="CC BY-NC-SA 4.0" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a></div></div></div></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"></div></div><link rel="stylesheet" href="https://npm.elemecdn.com/akiblog@1.0.1/css/coin.css" media="defer" onload='this.media="all"'><div class="post-reward"><button class="tip-button reward-button"><span class="tip-button__text">不给糖果就捣蛋</span><div class="coin-wrapper"><div class="coin"><div class="coin__middle"></div><div class="coin__back"></div><div class="coin__front"></div></div></div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="https://npm.elemecdn.com/akiblog@1.0.1/img/wechat.png" rel="external nofollow noreferrer" target="_blank"><img class="post-qr-code-img" src="" data-lazy-src="https://npm.elemecdn.com/akiblog@1.0.1/img/wechat.png" alt="wechat"></a><div class="post-qr-code-desc">wechat</div></li><li class="reward-item"><a href="https://npm.elemecdn.com/akiblog@1.0.1/img/alipay.png" rel="external nofollow noreferrer" target="_blank"><img class="post-qr-code-img" src="" data-lazy-src="https://npm.elemecdn.com/akiblog@1.0.1/img/alipay.png" alt="alipay"></a><div class="post-qr-code-desc">alipay</div></li></ul></div></button></div><audio id="coinAudio" src="https://npm.elemecdn.com/akilar-candyassets/audio/aowu.m4a"></audio><script defer src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/coin.js"></script><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="javascript:void(0);" rel="external nofollow noreferrer" onclick="SAONotify(&quot;Prev Post&quot;,&quot;是否跳转至上一篇：&lt;br&gt;博客顶栏菜单重写&quot;,&quot;pjax.loadUrl('/posts/eac2c3d0/')&quot;)" title="博客顶栏菜单重写"><i class="fas fa-chevron-left prev-icon"><div class="prev-label">上一篇</div></i></a><div class="pagination-card"><img class="prev-cover" src="" data-lazy-src="https://img.zcool.cn/community/0183d061dd8ce511013e8cd04451eb.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100/format,webp/quality,q_100" onerror='onerror=null,src="https://npm.elemecdn.com/akiblog@1.0.1/img/loading.gif"' alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">博客顶栏菜单重写</div></div></div></div><div class="next-post pull-right"><a href="javascript:void(0);" rel="external nofollow noreferrer" onclick="SAONotify(&quot;Next Post&quot;,&quot;是否跳转至下一篇：&lt;br&gt;活用githubAPI获取仓库commits作为更新日志&quot;,&quot;pjax.loadUrl('/posts/13a399e3/')&quot;)" title="活用githubAPI获取仓库commits作为更新日志"><i class="fas fa-chevron-right next-icon"><div class="next-label">下一篇</div></i></a><div class="pagination-card"><img class="next-cover" src="" data-lazy-src="https://img.zcool.cn/community/01593e61dd8ce411013e8cd0aa8bab.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100/format,webp/quality,q_100" onerror='onerror=null,src="https://npm.elemecdn.com/akiblog@1.0.1/img/loading.gif"' alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">活用githubAPI获取仓库commits作为更新日志</div></div></div></div></nav><hr><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i> <span>评论</span></div></div><div class="comment-wrap"><div><div id="twikoo-wrap"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-author"><div class="item-headline"><i class="fa-solid fa-circle-user"></i><span>作者信息</span></div><div class="author-main-content"><div class="author-check-content"><label class="author-info" for="author-info"><input id="author-info" type="checkbox" name="author-info"><div class="author-avatar"><img src="" data-lazy-src="https://npm.elemecdn.com/akiblog@1.0.1/img/author.webp" onerror='this.onerror=null,this.src="https://npm.elemecdn.com/akiblog@1.0.1/img/404.gif"' alt="avatar"></div><div class="author-name">Akilar</div></label></div><div class="author-switch-content"><input class="switch-content" type="radio" name="switch-content" value="description"><label class="author-description-box"><div class="author-description">流水幽吟绕耳边，<br>煦风馨语抚心弦，<br>挥臂欲揽冰钩月，<br>银星斟酌醉人涎。</div></label><input class="switch-content" type="radio" name="switch-content" value="social" checked><label class="author-social-box"><a class="card-author-button" target="_blank" rel="noopener external nofollow noreferrer" href="https://jq.qq.com/?_wv=1027&amp;k=tNuEdliQ"><i class="fa fa-paper-plane faa-tada"></i><span>加入糖果屋群聊</span></a><div class="social-icons"><a class="social-icon faa-parent animated-hover" href="https://github.com/Akilarlxh" rel="external nofollow noreferrer" target="_blank" title="Github"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-identity-01"></use></svg></a><a class="social-icon faa-parent animated-hover" href="mailto:Akilarlxh@gmail.com" rel="external nofollow noreferrer" target="_blank" title="Email"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-Openmail-01"></use></svg></a><a class="social-icon faa-parent animated-hover" href="https://space.bilibili.com/22976782" rel="external nofollow noreferrer" target="_blank" title="Bilibili"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-film-01"></use></svg></a><a class="social-icon faa-parent animated-hover" href="https://music.163.com/#/user/home?id=292643778" rel="external nofollow noreferrer" target="_blank" title="Cloudmusic"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-songlist-01"></use></svg></a><a class="social-icon faa-parent animated-hover" href="/atom.xml" target="_blank" title="RSS"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-pushpin-01"></use></svg></a></div></label><input class="switch-content" type="radio" name="switch-content" value="site-data"><label class="author-data-box"><div class="site-data"><a class="data-item" href="/archives/"><div class="data-name">文章</div><div class="data-length">480</div></a><a class="data-item" href="/tags/"><div class="data-name">标签</div><div class="data-length">63</div></a><a class="data-item" href="/categories/"><div class="data-name">分类</div><div class="data-length">6</div></a></div></label></div></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#python%E5%85%A5%E9%97%A8"><span class="toc-number">1.</span> <span class="toc-text">python入门</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%BC%95%E6%96%87"><span class="toc-number">2.</span> <span class="toc-text">引文</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%AE%9E%E4%BE%8B1%E2%80%94%E2%80%94%E6%95%B0%E6%8D%AE%E5%88%87%E7%89%87%E5%AF%BC%E5%87%BA"><span class="toc-number">3.</span> <span class="toc-text">实例1——数据切片导出</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%BC%96%E5%86%99%E8%BF%87%E7%A8%8B%E6%A2%B3%E7%90%86"><span class="toc-number">3.1.</span> <span class="toc-text">编写过程梳理</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%AE%9E%E4%BE%8B2%E2%80%94%E2%80%94%E7%AE%80%E5%8E%86%E8%A1%A8%E8%87%AA%E5%8A%A8%E7%94%9F%E6%88%90"><span class="toc-number">4.</span> <span class="toc-text">实例2——简历表自动生成</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%BC%96%E5%86%99%E8%BF%87%E7%A8%8B%E6%A2%B3%E7%90%86-1"><span class="toc-number">4.1.</span> <span class="toc-text">编写过程梳理</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%90%9C%E7%B4%A2%E6%80%9D%E8%B7%AF"><span class="toc-number">5.</span> <span class="toc-text">搜索思路</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%89%A9%E5%B1%95%E5%86%85%E5%AE%B9"><span class="toc-number">6.</span> <span class="toc-text">扩展内容</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%8F%82%E8%80%83%E6%96%87%E7%8C%AE"><span class="toc-number">7.</span> <span class="toc-text">参考文献</span></a></li></ol></div></div></div></div></main><footer id="footer"><div id="ark-footer-wraper"><div class="ark-footer-container"><div class="ark-footer-left-corner"><div id="ark-footer-bdage-container"><div class="ark-footer-bdage swiper-wrapper"><a class="ark-bdage-item swiper-slide" href="https://hexo.io/" rel="external nofollow noreferrer" title="博客框架为Hexo_v6.2.0" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-hexo"></use></svg><span>Frame-Hexo</span></a><a class="ark-bdage-item swiper-slide" href="https://butterfly.js.org/" rel="external nofollow noreferrer" title="主题版本Butterfly_v4.4.0" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-Butterfly"></use></svg><span>Theme-Butterfly</span></a><a class="ark-bdage-item swiper-slide" href="https://www.jsdelivr.com/" rel="external nofollow noreferrer" title="本站使用JsDelivr为静态资源提供CDN加速" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-jsdelivr"></use></svg><span>CDN-jsDelivr</span></a><a class="ark-bdage-item swiper-slide" href="https://console.dogecloud.com/" rel="external nofollow noreferrer" title="本网站由多吉云提供CDN加速服务" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-DOGE"></use></svg><span>CDN-dogecloud</span></a><a class="ark-bdage-item swiper-slide" href="https://beian.miit.gov.cn" title="本站已在工信部备案，备案号浙ICP备-2021026687号" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-a-255_icp-license"></use></svg><span>ICP-2021026687-1</span></a><a class="ark-bdage-item swiper-slide" href="https://icp.gov.moe/?keyword=20212887" title="本站已加入萌ICP豪华套餐，萌ICP备20212887号" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-space_demo_equipment"></use></svg><span>moeICP-20212887</span></a><a class="ark-bdage-item swiper-slide" href="https://www.netlify.com/" rel="external nofollow noreferrer" title="本站默认线路托管于Netlify" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-netlify"></use></svg><span>Hosted-Netlify</span></a><a class="ark-bdage-item swiper-slide" href="https://github.com/" rel="external nofollow noreferrer" title="本站项目由Github托管" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-GitHub"></use></svg><span>Source-Github</span></a><a class="ark-bdage-item swiper-slide" href="http://creativecommons.org/licenses/by-nc-sa/4.0/" rel="external nofollow noreferrer" title="本站采用知识共享署名-非商业性使用-相同方式共享4.0国际许可协议进行许可" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-copyright"></use></svg><span>Copyright-BY-NC-SA-4</span></a></div></div><div class="ark-footer-copyright">&copy;2016 - 2023 By Akilar</div><a class="ark-footer-record" target="_blank" rel="noopener" href="https://beian.miit.gov.cn" title="浙ICP备-2021026687号">浙ICP备-2021026687号</a></div><div class="ark-footer-right-corner"><div id="workboard"></div><script async src="/js/custom/runtime.js"></script></div></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open faa-pulse animated-hover"></i><span>阅读模式</span></button><button id="translateLink" type="button" title="简繁转换"><i>繁</i><span>简繁转换</span></button><a class="icon-V hidden" onclick="switchNightMode()" title="昼夜切换"><svg class="faa-pulse animated-hover" width="25" height="25" viewBox="0 0 1024 1024"><use id="modeicon" xlink:href="#icon-moon"></use></svg><span>昼夜切换</span></a><button id="hide-aside-btn" type="button" title="侧栏显隐"><i class="fas fa-arrows-alt-h faa-pulse animated-hover"></i><span>侧栏显隐</span></button><button id="SAO_Utils_Switch" type="button" title="右键开关" onclick="panelAudio(),SAOSwitch()"><i class="fas fa-mouse faa-pulse animated-hover"></i><span>右键开关</span></button><button id="SAO_Utils_Refresh" type="button" title="点击刷新" onclick="panelAudio(),fetchCommits()"><i class="fa-solid fa-arrows-rotate faa-pulse animated-hover"></i><span>点击刷新</span></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin faa-pulse animated-hover"></i><span>设置</span></button><button id="ranklist_show" type="button" title="打赏榜单" onclick="panelAudio(),RanklistBtn()"><i class="fas fa-fire-alt faa-pulse animated-hover"></i><span>打赏榜单</span></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul faa-pulse animated-hover"></i><span>目录</span></button><button id="chat_btn" type="button" title="与我联系"><i class="fas fa-sms faa-pulse animated-hover"></i><span>与我联系</span></button><button id="to_comment" type="button" title="直达评论" onclick="FixedCommentBtn()"><i class="fas fa-comments faa-pulse animated-hover"></i><span>直达评论</span></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up faa-pulse animated-hover"></i><span>回到顶部</span></button></div></div><div id="algolia-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="search-wrap"><div id="algolia-search-input"></div><hr><div id="algolia-search-results"><div id="algolia-hits"></div><div id="algolia-pagination"></div><div id="algolia-info"><div class="algolia-stats"></div><div class="algolia-poweredBy"></div></div></div></div></div><div id="search-mask"></div></div><div><script async src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/async.js"></script><script src="https://npm.elemecdn.com/akiblog@1.0.1/js/utils.js"></script><script src="https://npm.elemecdn.com/akiblog@1.0.1/js/main.js"></script><script defer src="https://npm.elemecdn.com/swiper@8.4.2/swiper-bundle.min.js"></script><script defer data-pjax src="/js/custom/swiper_init.js"></script><script src="https://npm.elemecdn.com/akiblog@1.0.1/js/tw_cn.js"></script><script src="https://npm.elemecdn.com/medium-zoom@1.0.6/dist/medium-zoom.min.js"></script><script src="https://npm.elemecdn.com/instant.page@5.1.1/instantpage.js" type="module"></script><script src="https://npm.elemecdn.com/vanilla-lazyload@17.3.1/dist/lazyload.iife.min.js"></script><script src="https://npm.elemecdn.com/node-snackbar@0.1.16/dist/snackbar.min.js"></script><script src="https://npm.elemecdn.com/algoliasearch@4.14.2/dist/algoliasearch-lite.umd.js"></script><script src="https://npm.elemecdn.com/instantsearch.js@4.44.0/dist/instantsearch.production.min.js"></script><script src="https://npm.elemecdn.com/akiblog@1.0.1/js/search/algolia.js"></script><div class="pjax-reload"><script async>var preloader={endLoading:()=>{if(document.body.style.overflow="auto",document.getElementById("loading-box").style.transition="opacity 3s",document.getElementById("loading-box").style.opacity="0",setTimeout((function(){document.getElementById("loading-box").classList.add("loaded")}),3e3),sessionStorage.getItem("isReload"))return!0;sessionStorage.setItem("isReload",!0),SAONotify("Welcome","欢迎光临糖果屋<br>愿你享受愉快的一天")},initLoading:()=>{document.body.style.overflow="",document.getElementById("loading-box").style.transition="",document.getElementById("loading-box").style.opacity="1",document.getElementById("loading-box").classList.remove("loaded")}};window.addEventListener("load",()=>{preloader.endLoading()}),document.getElementById("loading-box").addEventListener("click",()=>{preloader.endLoading()}),setTimeout((function(){preloader.endLoading()}),3e3)</script></div><div class="js-pjax"><script>(()=>{const t=()=>{twikoo.init(Object.assign({el:"#twikoo-wrap",envId:"https://twikoo-service.akilar.top",region:"",onCommentLoaded:function(){btf.loadLightbox(document.querySelectorAll("#twikoo .tk-content img:not(.tk-owo-emotion)"))}},null))},o=()=>{"object"!=typeof twikoo?getScript("https://npm.elemecdn.com/twikoo@1.6.5/dist/twikoo.all.min.js").then(t):setTimeout(t,0)};btf.loadComment(document.getElementById("twikoo-wrap"),o)})()</script></div><script>window.addEventListener("load",()=>{const e=e=>{let t="";if(e.length)for(let n=0;n<e.length;n++){t+="<div class='aside-list-item'>";{const a="data-lazy-src";t+=`<a href='${e[n].url}' class='thumbnail'><img ${a}='${e[n].avatar}' alt='${e[n].nick}'></a>`}t+=`<div class='content'>\n        <a class='comment' href='${e[n].url}' title='${e[n].content}'>${e[n].content}</a>\n        <div class='name'><span>${e[n].nick} / </span><time datetime="${e[n].date}">${btf.diffDate(e[n].date,!0)}</time></div>\n        </div></div>`}else t+="没有评论";let n=document.querySelector("#card-newest-comments .aside-list");n.innerHTML=t,window.lazyLoadInstance&&window.lazyLoadInstance.update(),window.pjax&&window.pjax.refresh(n)},t=()=>{if(document.querySelector("#card-newest-comments .aside-list")){const t=saveToLocal.get("twikoo-newest-comments");t?e(JSON.parse(t)):(()=>{const t=()=>{twikoo.getRecentComments({envId:"https://twikoo-service.akilar.top",region:"",pageSize:5,includeReply:!0}).then((function(t){const n=t.map(e=>{return{content:(t=e.comment,""===t||(t=(t=(t=(t=t.replace(/<img.*?src="(.*?)"?[^\>]+>/gi,"[图片]")).replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi,"[链接]")).replace(/<pre><code>.*?<\/pre>/gi,"[代码]")).replace(/<[^>]+>/g,"")).length>150&&(t=t.substring(0,150)+"..."),t),avatar:e.avatar,nick:e.nick,url:e.url+"#"+e.id,date:new Date(e.created).toISOString()};var t});saveToLocal.set("twikoo-newest-comments",JSON.stringify(n),10/1440),e(n)})).catch((function(e){document.querySelector("#card-newest-comments .aside-list").innerHTML="无法获取评论，请确认相关配置是否正确"}))};"object"==typeof twikoo?t():getScript("https://npm.elemecdn.com/twikoo@1.6.5/dist/twikoo.all.min.js").then(t)})()}};t(),document.addEventListener("pjax:complete",t)})</script><script src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/sun_moon.js" async></script><script async data-pjax src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/SAO-NAV.js"></script><script>WIDGET={CONFIG:{modules:"012",background:"5",tmpColor:"FFFFFF",tmpSize:"16",cityColor:"FFFFFF",citySize:"16",aqiColor:"FFFFFF",aqiSize:"16",weatherIconSize:"24",alertIconSize:"18",padding:"10px 10px 10px 10px",shadow:"0",language:"auto",fixed:"false",vertical:"top",horizontal:"left",key:"3da94e567f5e4e88baf90f066f0893c2"}}</script><script defer data-pjax src="https://widget.heweather.net/simple/static/js/he-simple.js?v=1.4.0"></script><script async src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/random.js"></script><script defer src="https://at.alicdn.com/t/c/font_3344355_e443xsjcmum.js"></script><script src="//code.tidio.co/wgamdwbirypo8casl6rjgtfbs47ny3s7.js" async></script><script>function onTidioChatApiReady(){window.tidioChatApi.hide(),window.tidioChatApi.on("close",(function(){window.tidioChatApi.hide()}))}window.tidioChatApi?window.tidioChatApi.on("ready",onTidioChatApiReady):document.addEventListener("tidioChat-ready",onTidioChatApiReady);var chatBtnFn=()=>{document.getElementById("chat_btn").addEventListener("click",(function(){window.tidioChatApi.show(),window.tidioChatApi.open()}))};chatBtnFn()</script><script src="https://npm.elemecdn.com/pjax@0.2.8/pjax.min.js"></script><script>let pjaxSelectors=["head > title","#config-diff","#body-wrap","#rightside-config-hide","#rightside-config-show",".js-pjax","#web_bg","#fixedcard-dashboard"];var pjax=new Pjax({elements:'a:not([target="_blank"])',selectors:pjaxSelectors,cacheBust:!1,analytics:!1,scrollRestoration:!1});document.addEventListener("pjax:send",(function(){if(window.tocScrollFn&&window.removeEventListener("scroll",window.tocScrollFn),window.scrollCollect&&window.removeEventListener("scroll",scrollCollect),"object"==typeof preloader&&preloader.initLoading(),document.getElementById("rightside").style.cssText="opacity: ''; transform: ''",window.aplayers)for(let e=0;e<window.aplayers.length;e++)window.aplayers[e].options.fixed||window.aplayers[e].destroy();"object"==typeof typed&&typed.destroy();const e=document.body.classList;e.contains("read-mode")&&e.remove("read-mode"),"object"==typeof disqusjs&&disqusjs.destroy()})),document.addEventListener("pjax:complete",(function(){window.refreshFn(),document.querySelectorAll("script[data-pjax], .pjax-reload script").forEach(e=>{const t=document.createElement("script"),o=e.text||e.textContent||e.innerHTML||"";Array.from(e.attributes).forEach(e=>t.setAttribute(e.name,e.value)),t.appendChild(document.createTextNode(o)),e.parentNode.replaceChild(t,e)}),GLOBAL_CONFIG.islazyload&&window.lazyLoadInstance.update(),"function"==typeof chatBtnFn&&chatBtnFn(),"function"==typeof panguInit&&panguInit(),"function"==typeof gtag&&gtag("config","",{page_path:window.location.pathname}),"object"==typeof _hmt&&_hmt.push(["_trackPageview",window.location.pathname]),"function"==typeof loadMeting&&document.getElementsByClassName("aplayer").length&&loadMeting(),"object"==typeof Prism&&Prism.highlightAll(),"object"==typeof preloader&&preloader.endLoading()})),document.addEventListener("pjax:error",e=>{404===e.request.status&&pjax.loadUrl("/404.html")})</script><script>"serviceWorker"in navigator&&(navigator.serviceWorker.controller&&navigator.serviceWorker.addEventListener("controllerchange",(function(){fetch("/json/commits.json").then(e=>e.json().then(e=>{for(var r=e,o=0;o<r.length;o++){r[o];var t=o+1+"."+r[o].commit.message;if(o<1)var n=t;else n=n+"<br>"+t}SAONotify("Latest Update",n,"location.reload(true);")})).catch(console.error)})),window.addEventListener("load",(function(){navigator.serviceWorker.register("/sw.js")})))</script><div id="SAO-back"><div id="SAO-menu"><div id="SAO-menu-content"><div class="utils-list"><div class="utils-list-item"><div class="user-panel" style="top:undefined"><div class="user-panel-name">Friends</div><div class="user-panel-img"><img src="" data-lazy-src="/img/info.png"></div><div class="user-panel-properties">Welcome to Akilar の Candyhome !</div></div><i class="fas fa-address-book" onclick="panelAudio(),UtilsClick()"></i><div class="menu-list" style="top:-83px"><div class="menu-list-item"><i class="fa fa-link" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/link/")}),500)'>Link</i></div><div class="menu-list-item"><i class="fas fa-fire-alt" onclick="clickAudio(),setTimeout((function(){SAOclose(),RanklistBtn()}),500)">Pantner</i></div></div></div><div class="utils-list-item"><div class="user-panel" style="top:undefined"><div class="user-panel-name">Help</div><div class="user-panel-img"><img src="" data-lazy-src="/img/info.png"></div><div class="user-panel-properties"><h4>Anything can I help you ?</h4><p>Tidio：开启在线聊天窗<br>Comment：直达评论区或留言板<br>Candyhome：加入糖果屋QQ群</p></div></div><i class="fa fa-question-circle" onclick="panelAudio(),UtilsClick()"></i><div class="menu-list" style="top:-103px"><div class="menu-list-item"><i class="fa fa-comment-dots" onclick="clickAudio(),setTimeout((function(){SAOclose(),openTidio()}),500)">Tidio</i></div><div class="menu-list-item"><i class="fa fa-comments" onclick="clickAudio(),setTimeout((function(){SAOclose(),FixedCommentBtn()}),500)">Comments</i></div><div class="menu-list-item"><i class="fa fa-user-friends" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("https://jq.qq.com/?_wv=1027&amp;k=a08BZRzs")}),500)'>Candyhome</i></div></div></div><div class="utils-list-item"><div class="user-panel" style="top:undefined"><div class="user-panel-name">Menu</div><div class="user-panel-img"><img src="" data-lazy-src="/img/info.png"></div><div class="user-panel-properties">The menu of my blog</div></div><i class="fa fa-tasks" onclick="panelAudio(),UtilsClick()"></i><div class="menu-list" style="top:-163px"><div class="menu-list-item"><i class="fa fa-home" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("https://blog.akilar.top/")}),500)'>Home</i></div><div class="menu-list-item"><i class="fa fa-folder-open" onclick="panelAudio(),MenusClick()">Document</i><div class="menu-child" style="top:-100px"><div class="menu-list-child"><i class="fa fa-file-invoice" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/posts/f99b208/")}),500)'>Beautify</i></div><div class="menu-list-child"><i class="fa fa-file-invoice" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/posts/7c16c4bb/")}),500)'>Optimize</i></div><div class="menu-list-child"><i class="fa fa-file-invoice" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/posts/615e2dec/")}),500)'>Tag_Plugins</i></div><div class="menu-list-child"><i class="fa fa-file-invoice" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/posts/6ef63e2d/")}),500)'>Construct</i></div></div></div><div class="menu-list-item"><i class="fa fa-blog" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/")}),500)'>Blog</i></div><div class="menu-list-item"><i class="fa fa-archive" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/archives/")}),500)'>Archives</i></div><div class="menu-list-item"><i class="fa fa-folder-open" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/categories/")}),500)'>Categoties</i></div><div class="menu-list-item"><i class="fa fa-tags" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/tags/")}),500)'>Tags</i></div></div></div><div class="utils-list-item"><div class="user-panel" style="top:undefined"><div class="user-panel-name">Options</div><div class="user-panel-img"><img src="" data-lazy-src="/img/info.png"></div><div class="user-panel-properties"><h4>Some userful scripts</h4><p>Random： 随机跳转站内文章<br>Search： 打开搜索窗口</p>Refresh： 刷新缓存</div></div><i class="fa fa-tools" onclick="panelAudio(),UtilsClick()"></i><div class="menu-list" style="top:-103px"><div class="menu-list-item"><i class="fa fa-random" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/toRandomPost()")}),500)'>Random</i></div><div class="menu-list-item"><i class="fa fa-search" onclick="clickAudio(),setTimeout((function(){SAOclose(),openSearch()}),500)">Search</i></div><div class="menu-list-item"><i class="fa-solid fa-arrows-rotate" onclick='clickAudio(),setTimeout((function(){SAOclose(),SAONotify("Refresh","即将为您刷新页面缓存","location.reload(true);")}),500)'>Refresh</i></div></div></div><div class="utils-list-item"><div class="user-panel"><div class="user-panel-name">Instructions</div><div class="user-panel-img"><img src="" data-lazy-src="/img/siteicon/favicon.png"></div><div class="user-panel-properties"><h4>欢迎使用SAO_Utils_Web 2.0</h4><p>点按选项可以持续显示下级菜单。您可以通过按住<kbd>ctrl</kbd>+<kbd>右键</kbd>来恢复使用原生右键菜单，更多内容可点击右侧Option按钮访问教程或Help按钮加入糖果屋QQ群。</p><center>©Akilarの糖果屋</center></div></div><i class="fa fa-cog" onclick="panelAudio(),UtilsClick()"></i><div class="menu-list" style="top:-103px"><div class="menu-list-item"><i class="fa fa-tools" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("https://akilar.top/posts/fd243d7/")}),500)'>Option</i></div><div class="menu-list-item"><i class="fa fa-question-circle" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("https://jq.qq.com/?_wv=1027&amp;k=a08BZRzs")}),500)'>Help</i></div><div class="menu-list-item"><i class="fa fa-sign-out-alt" onclick="alertAudio(),openLogout()">Logout</i></div></div></div><div class="utils-list-item"><i class="fa fa-power-off" onclick="alertAudio(),SAOKeepOff()" title="永久关闭SAO右键菜单"></i></div></div></div></div></div><div id="SAO-logout"><div class="logout-title">Alert</div><div class="logout-alert">是否确认退出?</div><div class="logout-button"><span class="logout-confirm"><button class="far fa-circle" type="button" name="confirm" onclick="clickAudio(),confirmLogout()"></button></span><span class="logout-cancel"><button class="fa fa-times" type="button" name="cancel" onclick="panelAudio(),cancelLogout()"></button></span></div></div><audio id="SAOlauncher" src="https://npm.elemecdn.com/akilar-candyassets/audio/Launcher.mp3"></audio><audio id="SAOClick" src="https://npm.elemecdn.com/akilar-candyassets/audio/Click.mp3"></audio><audio id="SAOPanel" src="https://npm.elemecdn.com/akilar-candyassets/audio/Panel.mp3"></audio><audio id="SAOAlert" src="https://npm.elemecdn.com/akilar-candyassets/audio/Alert.mp3"></audio><script async src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/SAO_Menu.js"></script><div id="SAO-ranklist"><div class="ranklist-title">Rank list</div><div class="ranklist-main"><div class="master-item"><div class="master-rank"><i class="fa fa-plus" onclick="panelAudio(),RanklistBtn()"></i></div><div class="master-user"><a alt="" href="/">Akilar<div class="rank-reward"><div class="reward-img"><img alt="" src="" data-lazy-src="https://npm.elemecdn.com/akiblog@1.0.1/img/wechat.png"><a class="reward-text" alt="" href="/null">wechat</a></div><div class="reward-img"><img alt="" src="" data-lazy-src="https://npm.elemecdn.com/akiblog@1.0.1/img/alipay.png"><a class="reward-text" alt="" href="/null">alipay</a></div></div></a></div><div class="master-data"><div class="master-HP"><div class="HP-fill" style="width:20%"><div class="HP-fill-in"><span>20%</span></div></div></div></div><div class="master-level"><span>270</span><span>|</span><span>1350</span><span>lv.23</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢*蓓打赏的￥180">*蓓</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:100%"><div class="HP-fill-in"><span>100.00%</span></div></div></div></div><div class="partner-level"><span>9200</span><span>|</span><span>9200</span><span>lv.180</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢晨打赏的￥8.88">晨</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:88.86%"><div class="HP-fill-in"><span>88.86%</span></div></div></div></div><div class="partner-level"><span>622</span><span>|</span><span>700</span><span>lv.10</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://zfe.space/" data-title="感谢**鄂打赏的￥9.9">**鄂</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:13.76%"><div class="HP-fill-in"><span>13.76%</span></div></div></div></div><div class="partner-level"><span>523</span><span>|</span><span>3800</span><span>lv.72</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢*光打赏的￥50">*光</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:92.59%"><div class="HP-fill-in"><span>92.59%</span></div></div></div></div><div class="partner-level"><span>2685</span><span>|</span><span>2900</span><span>lv.54</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢*洁打赏的￥30">*洁</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:93.78%"><div class="HP-fill-in"><span>93.78%</span></div></div></div></div><div class="partner-level"><span>1688</span><span>|</span><span>1800</span><span>lv.32</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢**焘打赏的￥20">**焘</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:90.92%"><div class="HP-fill-in"><span>90.92%</span></div></div></div></div><div class="partner-level"><span>1182</span><span>|</span><span>1300</span><span>lv.22</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://szsyzx.github.io/" data-title="感谢懒蟲打赏的￥20">懒蟲</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:74.06%"><div class="HP-fill-in"><span>74.06%</span></div></div></div></div><div class="partner-level"><span>1148</span><span>|</span><span>1550</span><span>lv.27</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢*i打赏的￥10">*i</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:83.38%"><div class="HP-fill-in"><span>83.38%</span></div></div></div></div><div class="partner-level"><span>667</span><span>|</span><span>800</span><span>lv.12</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://www.acozycotage.net/" data-title="感谢acozycotage打赏的￥10">acozycotage</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:NaN%"><div class="HP-fill-in"><span>NaN%</span></div></div></div></div><div class="partner-level"><span>NaN</span><span>|</span><span>NaN</span><span>lv.undefined</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢*因打赏的￥10">*因</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:62.5%"><div class="HP-fill-in"><span>62.50%</span></div></div></div></div><div class="partner-level"><span>625</span><span>|</span><span>1000</span><span>lv.16</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢H*g打赏的￥10">H*g</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:83.38%"><div class="HP-fill-in"><span>83.38%</span></div></div></div></div><div class="partner-level"><span>667</span><span>|</span><span>800</span><span>lv.12</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢**宁打赏的￥10">**宁</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:45.46%"><div class="HP-fill-in"><span>45.46%</span></div></div></div></div><div class="partner-level"><span>591</span><span>|</span><span>1300</span><span>lv.22</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://www.nesxc.com/" data-title="感谢Nesxc打赏的￥14.88">Nesxc</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:74.42%"><div class="HP-fill-in"><span>74.42%</span></div></div></div></div><div class="partner-level"><span>893</span><span>|</span><span>1200</span><span>lv.20</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢J*y打赏的￥2.56">J*y</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:51.11%"><div class="HP-fill-in"><span>51.11%</span></div></div></div></div><div class="partner-level"><span>230</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://www.lbihua.cn" data-title="感谢哔哗打赏的￥10">哔哗</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:62.5%"><div class="HP-fill-in"><span>62.50%</span></div></div></div></div><div class="partner-level"><span>625</span><span>|</span><span>1000</span><span>lv.16</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://iori-yimaga.top" data-title="感谢T*0打赏的￥23.3">T*0</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:93.17%"><div class="HP-fill-in"><span>93.17%</span></div></div></div></div><div class="partner-level"><span>1351</span><span>|</span><span>1450</span><span>lv.25</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢**飞打赏的￥20">**飞</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:74.06%"><div class="HP-fill-in"><span>74.06%</span></div></div></div></div><div class="partner-level"><span>1148</span><span>|</span><span>1550</span><span>lv.27</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢**豪打赏的￥10">**豪</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:83.38%"><div class="HP-fill-in"><span>83.38%</span></div></div></div></div><div class="partner-level"><span>667</span><span>|</span><span>800</span><span>lv.12</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://www.keyiqingxin.cn" data-title="感谢清心打赏的￥3.88">清心</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:19.42%"><div class="HP-fill-in"><span>19.42%</span></div></div></div></div><div class="partner-level"><span>233</span><span>|</span><span>1200</span><span>lv.20</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢鹿栖打赏的￥20">鹿栖</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:74.06%"><div class="HP-fill-in"><span>74.06%</span></div></div></div></div><div class="partner-level"><span>1148</span><span>|</span><span>1550</span><span>lv.27</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://menglei.xyz" data-title="感谢*夢打赏的￥3">*夢</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:27.33%"><div class="HP-fill-in"><span>27.33%</span></div></div></div></div><div class="partner-level"><span>205</span><span>|</span><span>750</span><span>lv.11</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://www.ijinse.cn" data-title="感谢锦瑟打赏的￥50">锦瑟</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:69.45%"><div class="HP-fill-in"><span>69.45%</span></div></div></div></div><div class="partner-level"><span>2639</span><span>|</span><span>3800</span><span>lv.72</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://glann.vip" data-title="感谢glann打赏的￥5.01">glann</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:41.75%"><div class="HP-fill-in"><span>41.75%</span></div></div></div></div><div class="partner-level"><span>334</span><span>|</span><span>800</span><span>lv.12</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢**忠打赏的￥4.48">**忠</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:89.56%"><div class="HP-fill-in"><span>89.56%</span></div></div></div></div><div class="partner-level"><span>403</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://huran.xyz" data-title="感谢忽然打赏的￥13.14">忽然</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:87.58%"><div class="HP-fill-in"><span>87.58%</span></div></div></div></div><div class="partner-level"><span>832</span><span>|</span><span>950</span><span>lv.15</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢XueZha打赏的￥6.66">XueZha</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:66.57%"><div class="HP-fill-in"><span>66.57%</span></div></div></div></div><div class="partner-level"><span>466</span><span>|</span><span>700</span><span>lv.10</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢*葵打赏的￥6.66">*葵</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:66.57%"><div class="HP-fill-in"><span>66.57%</span></div></div></div></div><div class="partner-level"><span>466</span><span>|</span><span>700</span><span>lv.10</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://tianli-blog.club" data-title="感谢天利打赏的￥40.34">天利</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:77.57%"><div class="HP-fill-in"><span>77.57%</span></div></div></div></div><div class="partner-level"><span>2172</span><span>|</span><span>2800</span><span>lv.52</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://bingmeng158.github.io" data-title="感谢冰梦打赏的￥1.5">冰梦</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:30%"><div class="HP-fill-in"><span>30.00%</span></div></div></div></div><div class="partner-level"><span>135</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://0410wzn.top" data-title="感谢WZN打赏的￥1.35">WZN</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:27.11%"><div class="HP-fill-in"><span>27.11%</span></div></div></div></div><div class="partner-level"><span>122</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢KD打赏的￥1.5">KD</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:30%"><div class="HP-fill-in"><span>30.00%</span></div></div></div></div><div class="partner-level"><span>135</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢**庆打赏的￥3.5">**庆</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:70%"><div class="HP-fill-in"><span>70.00%</span></div></div></div></div><div class="partner-level"><span>315</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://www.sunguoqi.com" data-title="感谢小孙打赏的￥5.2">小孙</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:52%"><div class="HP-fill-in"><span>52.00%</span></div></div></div></div><div class="partner-level"><span>364</span><span>|</span><span>700</span><span>lv.10</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://blog.nalex.top" data-title="感谢rootlex打赏的￥4">rootlex</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:80%"><div class="HP-fill-in"><span>80.00%</span></div></div></div></div><div class="partner-level"><span>360</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://dreamfall.cn" data-title="感谢梦落打赏的￥1.88">梦落</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:37.56%"><div class="HP-fill-in"><span>37.56%</span></div></div></div></div><div class="partner-level"><span>169</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://blog.cyfan.top" data-title="感谢CYF打赏的￥1.5">CYF</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:30%"><div class="HP-fill-in"><span>30.00%</span></div></div></div></div><div class="partner-level"><span>135</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢一悲打赏的￥2.5">一悲</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:41.6%"><div class="HP-fill-in"><span>41.60%</span></div></div></div></div><div class="partner-level"><span>208</span><span>|</span><span>500</span><span>lv.6</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://hexo.cf" data-title="感谢八神打赏的￥10">八神</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:83.38%"><div class="HP-fill-in"><span>83.38%</span></div></div></div></div><div class="partner-level"><span>667</span><span>|</span><span>800</span><span>lv.12</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://noionion.top" data-title="感谢贰猹打赏的￥20">贰猹</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:90.92%"><div class="HP-fill-in"><span>90.92%</span></div></div></div></div><div class="partner-level"><span>1182</span><span>|</span><span>1300</span><span>lv.22</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://blog.slqwq.cn" data-title="感谢Hajeekn打赏的￥10">Hajeekn</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:66.63%"><div class="HP-fill-in"><span>66.63%</span></div></div></div></div><div class="partner-level"><span>633</span><span>|</span><span>950</span><span>lv.15</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://baokan0.com" data-title="感谢baokan0打赏的￥20">baokan0</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:95.2%"><div class="HP-fill-in"><span>95.20%</span></div></div></div></div><div class="partner-level"><span>1190</span><span>|</span><span>1250</span><span>lv.21</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢h*d打赏的￥10">h*d</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:66.63%"><div class="HP-fill-in"><span>66.63%</span></div></div></div></div><div class="partner-level"><span>633</span><span>|</span><span>950</span><span>lv.15</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢**航打赏的￥10">**航</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:66.63%"><div class="HP-fill-in"><span>66.63%</span></div></div></div></div><div class="partner-level"><span>633</span><span>|</span><span>950</span><span>lv.15</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢I*u打赏的￥2">I*u</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:40%"><div class="HP-fill-in"><span>40.00%</span></div></div></div></div><div class="partner-level"><span>180</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢7*i打赏的￥1">7*i</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:20%"><div class="HP-fill-in"><span>20.00%</span></div></div></div></div><div class="partner-level"><span>90</span><span>|</span><span>450</span><span>lv.5</span></div></div></div></div><script async src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/SAO_ranklist.js"></script><div class="pjax-reload"><script async>for(var arr=document.getElementsByClassName("recent-post-item"),i=0;i<arr.length;i++)arr[i].classList.add("wow"),arr[i].classList.add("animate__zoomIn"),arr[i].setAttribute("data-wow-duration",""),arr[i].setAttribute("data-wow-delay",""),arr[i].setAttribute("data-wow-offset",""),arr[i].setAttribute("data-wow-iteration","")</script><script async>for(var arr=document.getElementsByClassName("card-widget"),i=0;i<arr.length;i++)arr[i].classList.add("wow"),arr[i].classList.add("animate__zoomIn"),arr[i].setAttribute("data-wow-duration",""),arr[i].setAttribute("data-wow-delay",""),arr[i].setAttribute("data-wow-offset",""),arr[i].setAttribute("data-wow-iteration","")</script><script async>for(var arr=document.getElementsByClassName("article-sort-item"),i=0;i<arr.length;i++)arr[i].classList.add("wow"),arr[i].classList.add("animate__zoomIn"),arr[i].setAttribute("data-wow-duration",""),arr[i].setAttribute("data-wow-delay",""),arr[i].setAttribute("data-wow-offset",""),arr[i].setAttribute("data-wow-iteration","")</script><script async>for(var arr=document.getElementsByClassName("flink-list-card"),i=0;i<arr.length;i++)arr[i].classList.add("wow"),arr[i].classList.add("animate__flipInY"),arr[i].setAttribute("data-wow-duration","1s"),arr[i].setAttribute("data-wow-delay",""),arr[i].setAttribute("data-wow-offset",""),arr[i].setAttribute("data-wow-iteration","")</script></div><script defer src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/wow.min.js"></script><script defer src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/wow_init.js"></script><div id="fixedcard-dashboard"><button class="fixedcard-activebtn" type="button" title="用户信息" onclick="FixedCardWidget(&quot;class&quot;,&quot;card-author&quot;,&quot;0&quot;)"><i class="fas fa-address-book"></i></button><button class="fixedcard-activebtn" type="button" title="相关推荐" onclick="FixedCardWidget(&quot;class&quot;,&quot;card-recommend-post&quot;,&quot;0&quot;)"><i class="fas fa-dharmachakra"></i></button><div class="fixedcard-user-avatar fixedcard-activebtn" onclick="RemoveFixedCardWidget()"><img class="fixedcard-user-avatar-img" src="" data-lazy-src="https://npm.elemecdn.com/akiblog@1.0.1/img/author.webp" title="Akilar"></div></div><script defer data-pjax src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/fixed_card_widget.js"></script><script defer data-pjax src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/fixed_comment.js"></script></div><script>var fdata={apiurl:"/json/akifcircle.json",initnumber:20,stepnumber:10,error_img:"https://npm.elemecdn.com/akilar-candyassets/image/404.gif"};localStorage.setItem("fdatalist",JSON.stringify(fdata))</script><script defer src="https://npm.elemecdn.com/hexo-filter-fcircle/assets/js/fetch.js"></script><script data-pjax src="https://npm.elemecdn.com/hexo-filter-gitcalendar/lib/gitcalendar.js"></script><script data-pjax>function gitcalendar_injector_config(){document.getElementById("recent-posts").insertAdjacentHTML("afterbegin",'<div class="recent-post-item" id="gitcalendarBar" style="width:100%;height:auto;padding:10px;"><style>#git_container{min-height: 280px}@media screen and (max-width:650px) {#git_container{min-height: 0px}}</style><div id="git_loading" style="width:10%;height:100%;margin:0 auto;display: block;"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50" xml:space="preserve"><path fill="#d0d0d0" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" transform="rotate(275.098 25 25)"><animatetransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"></animatetransform></path></svg><style>#git_container{display: none;}</style></div><div id="git_container"></div></div>'),console.log("已挂载gitcalendar")}document.getElementById("recent-posts")&&"/"===location.pathname&&(gitcalendar_injector_config(),GitCalendarInit("/json/akicalendar.json",["#e4dfd7","#f9f4dc","#f7e8aa","#f7e8aa","#f8df72","#fcd217","#fcc515","#f28e16","#fb8b05","#d85916","#f43e06"],"Akilarlxh"))</script></body></html>